[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Intelligent stacking of messages in the echo area
From: |
Juri Linkov |
Subject: |
Re: Intelligent stacking of messages in the echo area |
Date: |
Wed, 29 Jan 2020 00:34:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.60 (x86_64-pc-linux-gnu) |
>> Good heuristics. Another heuristics that could be added is
>> to filter out transient messages ending with ellipsis -
>> added here to a new variable like Eli asked to do:
>
> Just to say thank you. I've been using this bit of code for the past
> two or three weeks and it works very well.
>
> I added to your regex for my particular situation:
>
> #+begin_src elisp
> (defcustom multi-message-transient "\\(\\.\\.\\.\\'\\|^,\\|^C-\\|^pop3
> retrieved\\)"
> "Regexp to filter out transient messages that should not be stacked."
> :type 'regexp
> :group 'minibuffer
> :version "28.1")
> #+end_src
Thanks. This means that this option multi-message-transient is useful after
all.
BTW, I customized it to "^Mark\\|\\.\\.\\.\\'" to skip mark-related messages
like "Mark set" and "Mark deactivated".
Now what remains to do is to combine multi-message feature with
minibuffer-message,
so when the minibuffer is not active then multi-line messages are displayed
in the echo-area, otherwise multi-line messages are displayed at the end
of the minibuffer:
(defun set-multi-message--wrapper (orig-fun message)
(let* ((multi-message (set-multi-message message)))
(or (funcall orig-fun multi-message)
multi-message)))
(setq set-message-function 'set-minibuffer-message)
(add-function :around set-message-function #'set-multi-message--wrapper)