[Top][All Lists]

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

Re: help needed with gnus mode-line

From: Stefan Monnier
Subject: Re: help needed with gnus mode-line
Date: Fri, 01 Jul 2011 12:23:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>   (with-current-buffer (with-selected-window
>                            (minibuffer-selected-window)
>                          (current-buffer))

Try (window-buffer (minibuffer-selected-window)) ;-)

Of course, minibuffer-selected-window is not quite right either: you
don't want to modify the mode-line of the buffer from where the M-: was
typed, but the mode-line that's right above the minibuffer (which
doesn't even exist in minibuffer-only frames).

> Which use the minibuffer only with gnus buffers.
> In other place in emacs it use the current-buffer of the selected window
> before entering the minibuffer.

No, the problem is that if you don't switch to the other buffer, your
let binding will change the mode-line-format value in the minibuffer and
since the minibuffer basically never sets this value buffer-locally it
means it changes (temporarily) the default value of mode-line-format,
i.e. it changes the value of mode-line-format for all buffers that
haven't set it buffer-locally (i.e. all buffers except Gnus buffers and
a few other ones).

If you have several windows, you should see that your mode-line message
appears in pretty much all mode lines rather than only the one next to
the minibuffer (tho calling force-mode-line-update with a nil may be
sufficient to restrict the change to the window(s) that show this buffer
in many cases).


reply via email to

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