[Top][All Lists]

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

Re: Does display-buffer display the buffer or not?

From: Tassilo Horn
Subject: Re: Does display-buffer display the buffer or not?
Date: Fri, 24 Dec 2010 09:15:15 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Lennart Borgman <address@hidden> writes:

Hi Lennart,

> The doc string for displayb buffer begins like this:
>   Make buffer BUFFER-OR-NAME appear in some window but don't select it.
>   BUFFER-OR-NAME must be a buffer or the name of an existing
>   buffer.  Return the window chosen to display BUFFER-OR-NAME or
>   nil if no such window is found.
> I do not understand the last sentence. Could it happen that the buffer
> is not displayed? In that case, should not that be an error?

My first idea was that when you say NOT-THIS-WINDOW (t) and the current
FRAME (nil), but the current frame has only one window and is only of
minimal size, so no split can be done, then it must return nil and do
nothing.  Unfortunately, testing that situation with

  (display-buffer "*info*" t nil)

pops up a completely new frame showing *info*.  Reading the docs a bit
further, there is

,----[ C-h f display-buffer RET ]
| [...]
| nil - consider windows on the selected frame (actually the
| last non-minibuffer frame) only.  If, however, either
| `display-buffer-reuse-frames' or `pop-up-frames' is non-nil
| (non-nil and not graphic-only on a text-only terminal),
| consider all visible or iconified frames.

Unfortunately, both `display-buffer-reuse-frames' and `pop-up-frames'
are nil, here.

I do think that creating a new frame is appropriate in the situation
above, but the docs should make that clear.  Currently, they don't match
the implemented behavior.


reply via email to

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