all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eric Abrahamsen <eric@ericabrahamsen.net>, help-gnu-emacs@gnu.org
Subject: RE: Message queue for Emacs?
Date: Sun, 23 Apr 2017 13:47:44 -0700 (PDT)	[thread overview]
Message-ID: <801751ec-b79a-4d11-90e0-b86b2dae6da0@default> (raw)
In-Reply-To: <87pog26gz7.fsf@ericabrahamsen.net>

> >> 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.



  reply	other threads:[~2017-04-23 20:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-23 17:44 Message queue for Emacs? Marcin Borkowski
2017-04-23 18:27 ` Drew Adams
2017-04-23 19:50   ` Eric Abrahamsen
2017-04-23 20:47     ` Drew Adams [this message]
2017-04-23 21:21       ` Eric Abrahamsen
2017-04-23 19:29 ` Göktuğ Kayaalp
2017-04-24  0:37 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=801751ec-b79a-4d11-90e0-b86b2dae6da0@default \
    --to=drew.adams@oracle.com \
    --cc=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.