Re: Let temporary minibuffer messages replace current minibuffer contents?
Frank Steiner <[email protected]>
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <[email protected]> |
Michael Heerdegen via Users list for the GNU Emacs text editor wrote:
> Note that in your example - where an error occurs while a minibuffer is
> active - we are speaking about `command-error-function'.
>
> `minibuffer-error-initialize' sets this variable to
> `minibuffer-error-function' locally in minibuffers, which still appends
> to the minibuffer contents AFAICT. To get rid of that you probably have
> to replace `minibuffer-error-initialize' in `minibuffer-setup-hook' with
> something that you like.
For the moment I just use sth. very easy which allows me to show
only the error message for certain buffers, while it is still added
at the end for others:
(defun hide-minibuffer-prompt (m)
(let ((inhibit-read-only t))
(if (string-match "^\\(Find File:\\|Switch to buffer\\)" (minibuffer-prompt))
(add-text-properties 1 (point-max) '(invisible t)))))
(defun show-minibuffer-prompt (m)
(let ((inhibit-read-only t))
(remove-text-properties 1 (point-max) '(invisible t))))
(advice-add 'minibuffer-message :before #'hide-minibuffer-prompt)
(advice-add 'minibuffer-message :after #'show-minibuffer-prompt)
That works fine for my specual use case...
cu,
Frank