Subject: Re: bug#18181: bug in display-buffer-below-selected

From: Juri Linkov <[email-masked]>
Date: Tue, 05 Aug 2014 02:58:04 +0300

>>       (let ((buffer (get-buffer-create "test-buffer")))
>>         (display-buffer-below-selected buffer nil)
>>         (display-buffer-below-selected buffer nil))
>
> This is the intended behavior.  `display-buffer-at-bottom' and
> `display-buffer--maybe-pop-up-frame-or-window' also display the buffer a
> second time even if it's already shown.  The correct use of this is to
> try `display-buffer-reuse-window' before `display-buffer-below-selected'.

I agree that `display-buffer-below-selected' should be prepended by
`display-buffer-reuse-window' in the list of display actions
when there is a need to reuse an already displayed window like

  (let ((buffer (get-buffer-create "test-buffer")))
    (display-buffer buffer `((display-buffer-reuse-window
                              display-buffer-below-selected)))
    (display-buffer buffer `((display-buffer-reuse-window
                              display-buffer-below-selected))))

>> This behavior seems to have been introduced in git commit
>>       6a5d9e9a3247566bf69575444e2a1f75f5b3e021
>> in the emacs-24 branch of git://git.savannah.gnu.org/emacs.git
>
> Can you please tell me which commit this was.  I don't have git.

It's bzr revno 115543 from our discussion at bug#16115
that removed the need to add `(split-height-threshold 0)'
to every use of `display-buffer-below-selected'.