all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Message queue for Emacs?
@ 2017-04-23 17:44 Marcin Borkowski
  2017-04-23 18:27 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Marcin Borkowski @ 2017-04-23 17:44 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi there,

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.

TIA,

--
Marcin Borkowski



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Message queue for Emacs?
  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 19:29 ` Göktuğ Kayaalp
  2017-04-24  0:37 ` Emanuel Berg
  2 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2017-04-23 18:27 UTC (permalink / raw)
  To: Marcin Borkowski, Help Gnu Emacs mailing list

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

But once the next message is displayed the previous one is lost
(from the echo area).  The rest of what you wrote makes it sound
like you want a list of messages that you can traverse, to get
previous messages (?) (other than from `*Messages*', presumably).



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Message queue for Emacs?
  2017-04-23 17:44 Message queue for Emacs? Marcin Borkowski
  2017-04-23 18:27 ` Drew Adams
@ 2017-04-23 19:29 ` Göktuğ Kayaalp
  2017-04-24  0:37 ` Emanuel Berg
  2 siblings, 0 replies; 7+ messages in thread
From: Göktuğ Kayaalp @ 2017-04-23 19:29 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Help Gnu Emacs mailing list

On 2017-04-23 19:44 +02, Marcin Borkowski <mbork@mbork.pl> wrote:
> Hi there,
>
> 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.

I once thought about advicing `message' so that it CCs messages to
notify-osd.  Didn't implement, but should not be hard to do.  Libnotify
strings notifications on screen so that multiple ones can appear
simultaneously.

> TIA,
>
> --
> Marcin Borkowski



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Message queue for Emacs?
  2017-04-23 18:27 ` Drew Adams
@ 2017-04-23 19:50   ` Eric Abrahamsen
  2017-04-23 20:47     ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2017-04-23 19:50 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

>> 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. It could be
interesting if Emacs just piled up messages and displayed them one per
second, without blocking whatever comes next. If whatever comes next
waits for user input in the minibuffer, hitting any key would cancel/flush
the rest of the queue.

I can imagine all kinds of things going wrong, but it could be fun.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Message queue for Emacs?
  2017-04-23 19:50   ` Eric Abrahamsen
@ 2017-04-23 20:47     ` Drew Adams
  2017-04-23 21:21       ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2017-04-23 20:47 UTC (permalink / raw)
  To: Eric Abrahamsen, help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Message queue for Emacs?
  2017-04-23 20:47     ` Drew Adams
@ 2017-04-23 21:21       ` Eric Abrahamsen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2017-04-23 21:21 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

>> >> 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")

No kidding! I never knew that -- I guess I've never tried to use it.

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

Beat me, too. My guess was that he wanted this to be the default
behavior for message. But I really don't know.

Thanks for the tip,
Eric




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Message queue for Emacs?
  2017-04-23 17:44 Message queue for Emacs? Marcin Borkowski
  2017-04-23 18:27 ` Drew Adams
  2017-04-23 19:29 ` Göktuğ Kayaalp
@ 2017-04-24  0:37 ` Emanuel Berg
  2 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2017-04-24  0:37 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski wrote:

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

Easy!

First re-write `message' and re-compile Emacs
to put all messages in a data structure, then
setup the idle timer with some periodic delay,
say every one or two seconds, to clear the list
message by message and have them appear in
a three or four line buffer that appears at the
bottom of the screen whenever there are
messages, and disappears when the data
structure is empty!

That should be pretty simple :)

As for advice as proposed in another post that
would I suspect only be a partial solution as
`message' is in C, and probably often called
from C as well.

> I know about C-h e (view-echo-area-messages),
> but this is not what I'm after.

Why not? Just open the *Messages* buffer when
you feel like you have missed a message or two.

In general I think that the messages are an
underpowered feature in Emacs. In particular,
I'd like a list with unasked for messages that
won't be displayed. Every time a message is to
be displayed, that list would be consulted to
see if there is a match, and if it is, it
shouldn't be displayed.

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-04-24  0:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2017-04-23 21:21       ` Eric Abrahamsen
2017-04-23 19:29 ` Göktuğ Kayaalp
2017-04-24  0:37 ` Emanuel Berg

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.