[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Message queue for Emacs?
From: |
Drew Adams |
Subject: |
RE: Message queue for Emacs? |
Date: |
Sun, 23 Apr 2017 13:47:44 -0700 (PDT) |
> >> a lot of Emacs commands send a (message "...") for a user in the echo
> >> area. Now imagine a command that sends more than of them (not unlikely
> >> e.g. if there are a few hooks, each printing a message). Of course,
> >> only the last one is then visible. Is there any way for the next
> >> message to be printed with some delay, so that the previous one is
> >> still visible, say, for a second or two?
> >>
> >> I know about C-h e (view-echo-area-messages), but this is not what I'm
> >> after.
> >
> > See `sit-for' and `sleep-for'.
>
> The disadvantage of that is that it would be blocking.
Not `sit-for'.
> It could be
> interesting if Emacs just piled up messages and displayed them one per
> second, without blocking whatever comes next.
(message "A") (sit-for 1.0) (message "B") (sit-for 1.0) ...
(message "Z")
> If whatever comes next waits for user input in the minibuffer,
> hitting any key would cancel/flush the rest of the queue.
Again, `sit-for' does that, and regardless of whether input is
to the minibuffer. Any user event cancels and flushes.
> I can imagine all kinds of things going wrong, but it could be fun.
It's unclear just what the OP is asking for (or why).
If code issues calls to `message' in sequence, and if it wants
to be sure the user sees messages other than just the last one,
then a wait after each is appropriate, whether blocking or not.
`sleep-for' blocks. `sit-for' does not, but it waits the
allotted time if there is no user event.