all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: ndame <emacsuser@freemail.hu>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Intelligent stacking of messages in the echo area
Date: Wed, 25 Dec 2019 13:35:03 +0800	[thread overview]
Message-ID: <87blrxdl2w.fsf@localhost> (raw)
In-Reply-To: <875zi5ntts.fsf@mail.linkov.net>

> Maybe this is because multi-line messages resize the echo-area window
> every time a new message line is added (when resize-mini-windows is non-nil),
> so height changes of the echo-area window invoke window-configuration-change-hook.

I suspect that it is exactly the case.
However, window-configuration-change-hook is not fired so frequently in
other functions like split-window.
Most likely, it is because window-configuration-change-hook is only
called during redisplay. From its docstring:
"Functions called during redisplay when window configuration has
changed."

I guess that resizing echo-area forcefully calls redisplay and hence
window-configuration-change-hook, thus slowing down command execution.

Best,
Ihor

> Now for the multi-message feature where multi-line messages are
> not an exception but a rule, one way to mitigate it is to use
> a message separator other than a newline, e.g.
>
> (setq multi-message-separator (propertize ";" 'face 'minibuffer-prompt))
>
> In a wide frame, one echo-area line can accommodate several short messages
> without resizing the echo-area window.

This is a workaround, not a solution.
Also, I am using a laptop with small screen and this workaround does not
really work for me (at least for org-capture, which emits fairly long
messages).



Juri Linkov <juri@linkov.net> writes:

>> I was testing the code for a while.
>> There seem to be one irritating (for me) problem with the way
>> set-message-function is implemented.
>> When I run a command changing current buffer and emitting multiple
>> messages, emacs frame is redrawn every time a new message comes out.
>> Specifically, I was running org-capture, which changes windows
>> configuration, switches to different buffer, and emits multiple messages
>> while running. Normally, it runs very fast (the capture template I used
>> does not require any user input), but with multi-message, I can see the
>> frame being redrawn on every new message popping up. Since window
>> configuration is different, full redraw is forced and the whole
>> org-capture runs a lot slower.
>
> Maybe this is because multi-line messages resize the echo-area window
> every time a new message line is added (when resize-mini-windows is non-nil),
> so height changes of the echo-area window invoke window-configuration-change-hook.
>
> It seems the same problem existed for a long time, but had no noticeable effect
> because multi-line messages were rare.
>
> Now for the multi-message feature where multi-line messages are
> not an exception but a rule, one way to mitigate it is to use
> a message separator other than a newline, e.g.
>
> (setq multi-message-separator (propertize ";" 'face 'minibuffer-prompt))
>
> In a wide frame, one echo-area line can accommodate several short messages
> without resizing the echo-area window.

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg



  reply	other threads:[~2019-12-25  5:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-31  5:35 Intelligent stacking of messages in the echo area ndame
2019-08-31  9:46 ` Marcin Borkowski
2019-12-21 22:07 ` Juri Linkov
2019-12-22  3:30   ` Eli Zaretskii
2019-12-23  2:59   ` Richard Stallman
2019-12-23 22:46     ` Juri Linkov
2019-12-23  3:50   ` Ihor Radchenko
2019-12-23 13:38     ` Eli Zaretskii
2019-12-24  9:24       ` Ihor Radchenko
2019-12-24 15:36         ` Eli Zaretskii
2019-12-25  4:21           ` Ihor Radchenko
2019-12-23 22:47     ` Juri Linkov
2019-12-24  9:40       ` Ihor Radchenko
2019-12-24 15:43         ` Eli Zaretskii
2019-12-24 17:32           ` Ihor Radchenko
2019-12-25  0:15         ` Juri Linkov
2019-12-25  5:35           ` Ihor Radchenko [this message]
2020-01-29 22:54             ` Juri Linkov
2020-01-24 10:14       ` Eric S Fraga
2020-01-28 22:34         ` Juri Linkov
2020-01-29 22:41           ` Juri Linkov
2020-01-29 23:53             ` Stefan Monnier
2020-01-30 22:35               ` Juri Linkov
2020-01-30 23:07                 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2022-04-09  4:46 emacsq
2022-04-09 18:53 ` Juri Linkov

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=87blrxdl2w.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacsuser@freemail.hu \
    --cc=juri@linkov.net \
    /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.