GNU bug report logs -
#18181
bug in display-buffer-below-selected
Previous Next
Reported by: Trevor Jim <tjim <at> mac.com>
Date: Sun, 3 Aug 2014 15:24:01 UTC
Severity: minor
Tags: notabug
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18181 in the body.
You can then email your comments to 18181 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Sun, 03 Aug 2014 15:24:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Trevor Jim <tjim <at> mac.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 03 Aug 2014 15:24:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello. I am seeing what I think is a bug in
display-buffer-below-selected in recent versions of emacs-24.3.
Namely, if you execute display-buffer-below-selected when the buffer
is already in a window below selected, you will get *two* windows
showing the buffer. A simple test is to run
(let ((buffer (get-buffer-create "test-buffer")))
(display-buffer-below-selected buffer nil)
(display-buffer-below-selected buffer nil))
in *scratch*.
This behavior seems to have been introduced in git commit
6a5d9e9a3247566bf69575444e2a1f75f5b3e021
in the emacs-24 branch of git://git.savannah.gnu.org/emacs.git
-T
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Mon, 04 Aug 2014 17:23:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 18181 <at> debbugs.gnu.org (full text, mbox):
> Hello. I am seeing what I think is a bug in
> display-buffer-below-selected in recent versions of emacs-24.3.
>
> Namely, if you execute display-buffer-below-selected when the buffer
> is already in a window below selected, you will get *two* windows
> showing the buffer. A simple test is to run
>
> (let ((buffer (get-buffer-create "test-buffer")))
> (display-buffer-below-selected buffer nil)
> (display-buffer-below-selected buffer nil))
>
> in *scratch*.
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'.
> 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.
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Mon, 04 Aug 2014 17:55:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 18181 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> This is the intended behavior
OK. Just FYI however, there has been a change in behavior. It's
possible that other software has been affected by the change. For
example, the reason I used display-buffer-below-selected was because I
saw it used in rmail. You might want to make sure that rmail is still
working correctly.
I'm not sure how it corresponds to bzr but you can see the git commit
here:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6a5d9e9a3247566bf69575444e2a1f75f5b3e021
With that commit I see the new behavior. Before that commit, all the
way up to 24.3 at least, I see the old behavior.
Also: I have to say that looking at the documentation it is hard to
say what the intended behavior is.
Thanks,
Trevor
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Tue, 05 Aug 2014 00:11:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 18181 <at> debbugs.gnu.org (full text, mbox):
>> (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'.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Tue, 05 Aug 2014 08:37:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 18181 <at> debbugs.gnu.org (full text, mbox):
>> This is the intended behavior
>
> OK.
I'm afraid you don't like it. But let me explain why it's this way: As
a first step, `display-buffer' usually searches all windows whether the
buffer is already displayed. This search doesn't come without any cost
because we have to check whether the selected window or another frame
are eligible. Hence, it makes sense to do that search in the separate
action function `display-buffer-reuse-window'. Usually, that function
is the very first tried by `display-buffer'.
The remaining action functions have been written based on the idea that
`display-buffer-reuse-window' already failed to find a suitable window
and either a new window or one that doesn't display the buffer already
has to be provided.
> Just FYI however, there has been a change in behavior. It's possible that other software has been affected by the change. For example, the reason I used display-buffer-below-selected was because I saw it used in rmail. You might want to make sure that rmail is still working correctly.
Can you elaborate how rmail might be affected by this?
> I'm not sure how it corresponds to bzr but you can see the git commit here:
>
> http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6a5d9e9a3247566bf69575444e2a1f75f5b3e021
>
> With that commit I see the new behavior. Before that commit, all the way up to 24.3 at least, I see the old behavior.
I understand what you mean now. That indeed changed the behavior for
the "frame has more than one window" case. Though IIRC its intention
was to handle the case where the buffer is _not_ displayed yet, a fact
`display-buffer-reuse-window' should have implicitly checked before.
> Also: I have to say that looking at the documentation it is hard to say what the intended behavior is.
As a rule: The idea is that an application should always try
`display-buffer-reuse-window' first unless the intended behavior is to
strictly use a new window or one that displays another buffer. If you
(or anyone else) have any good ideas how to change the documentation
such that this idea becomes immediately evident, please don't hesitate
to propose the necessary change. I have not written the present
documentation and my English probably isn't well enough to do the job.
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Tue, 05 Aug 2014 14:08:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 18181 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> I'm afraid you don't like it.
Actually it doesn't matter to me, I've fixed my program to work either way. I am just pointing out the change of behavior in case someone else has been relying on it.
Thanks,
-Trevor
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Sat, 09 Aug 2014 17:05:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 18181 <at> debbugs.gnu.org (full text, mbox):
> Actually it doesn't matter to me, I've fixed my program to work either way. I am
> just pointing out the change of behavior in case someone else has been relying
> on it.
In revision#117435 of the emacs-24 branch I restored the old behavior
for the case where the buffer already appears below the selected window.
As soon as you've updated (on trunk this might take a couple of days)
kindly check whether it now behaves as you expected before.
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18181
; Package
emacs
.
(Sun, 10 Aug 2014 00:02:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 18181 <at> debbugs.gnu.org (full text, mbox):
> In revision#117435 of the emacs-24 branch I restored the old behavior
> for the case where the buffer already appears below the selected window.
Maybe the same would be good also for `display-buffer-at-bottom'
to reuse the window already displayed at the bottom?
Reply sent
to
martin rudalics <rudalics <at> gmx.at>
:
You have taken responsibility.
(Fri, 29 Aug 2014 10:48:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Trevor Jim <tjim <at> mac.com>
:
bug acknowledged by developer.
(Fri, 29 Aug 2014 10:48:03 GMT)
Full text and
rfc822 format available.
Message #31 received at 18181-done <at> debbugs.gnu.org (full text, mbox):
> > In revision#117435 of the emacs-24 branch I restored the old behavior
> > for the case where the buffer already appears below the selected window.
>
> Maybe the same would be good also for `display-buffer-at-bottom'
> to reuse the window already displayed at the bottom?
Done. I also now (re-)use the leftmost suitable window at the bottom of
the frame. Please have a look. Closing this bug.
Thanks, martin
PS: I apparently never received this mail here and only incidentally
found it now via http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18181.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 26 Sep 2014 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 10 years and 263 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.