[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Annoying paren match messages in minibuffer

From: Juri Linkov
Subject: Re: Annoying paren match messages in minibuffer
Date: Wed, 14 Jan 2009 23:12:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

> I do the same thing myself, but only as a separate function. So when I want
> unconditional behavior (regardless of the current buffer) I can still call
> either `message' or `minibuffer-message' instead.

As a general solution it would be better to change `message'
to take care about the minibuffer's case.

> BTW, don't you need to ensure that the minibuffer window is active?

I think `active-minibuffer-window' is not suitable for this.
It returns non-nil even when the current buffer is not the minibuffer,
but there is no need to do this because it doesn't clobber the
current user input (i.e. when the user switched from the active
minibuffer to another buffer).

> FWIW, this is the code I use:
> (defun msg-maybe-in-minibuffer (format-string &rest args)
>   "Display FORMAT-STRING as a message.
> If called with the minibuffer inactive, use `message'.
> Otherwise, use `minibuffer-message'."
>   (if (active-minibuffer-window)
>       (save-selected-window
>         (select-window (minibuffer-window))
>         (minibuffer-message
>          (apply #'format
>                 (concat "  [" format-string "]") args)))
>     (apply #'message format-string args)))

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]