unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#410: 23.0.60; display-buffer regression
@ 2008-06-13 22:04 Stephen Berman
  2008-06-14  9:40 ` martin rudalics
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Berman @ 2008-06-13 22:04 UTC (permalink / raw)
  To: emacs-pretest-bug

In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.12.0)
 of 2008-06-13 on escher

The recent reimplementation of display-buffer in lisp resulted in the
following changed behavior, which I consider a regression:

1. emacs -Q

2. M-x calendar 
   ==> The window is vertically split, the *scratch* buffer above and
   the Calendar buffer is below in a smaller window sized to fit.

3. M-: (pop-to-buffer (get-buffer "*Messages*"))
   ==> Now the *Messages* buffer is above and the Calendar buffer is
   still below, but the windows are evenly split, i.e. the Calendar
   window is no longer sized to fit but is too big.  Prior to the
   reimplementation of display-buffer doing this step did not change the
   height of the Calendar window.

The behavior in step 3 results from the invocation of
window--even-window-heights in the last clause of the cond in
display-buffer, which happens because the *Messages* buffer exits but is
not displayed.  If the sexp in step 3 contained *scratch* instead of
*Messages*, the height of the Calendar window would not have changed.

Looking at the pre-reimplementation source of Fdisplay_buffer, it looks
like the window heights should get evened out just as in the lisp
reimplementation; nevertheless, this is not what happens in the above
recipe with the older code.  (I wanted to step through the code with gdb
but for some reason gdb failed to halt execution in the right source
file, so I could not pursue this.)

Steve Berman






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#410: 23.0.60; display-buffer regression
  2008-06-13 22:04 bug#410: 23.0.60; display-buffer regression Stephen Berman
@ 2008-06-14  9:40 ` martin rudalics
  2008-06-14 22:34   ` Stephen Berman
  0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2008-06-14  9:40 UTC (permalink / raw)
  To: Stephen Berman, 410; +Cc: emacs-pretest-bug

 > The recent reimplementation of display-buffer in lisp resulted in the
 > following changed behavior, which I consider a regression:
 >
 > 1. emacs -Q
 >
 > 2. M-x calendar
 >    ==> The window is vertically split, the *scratch* buffer above and
 >    the Calendar buffer is below in a smaller window sized to fit.
 >
 > 3. M-: (pop-to-buffer (get-buffer "*Messages*"))
 >    ==> Now the *Messages* buffer is above and the Calendar buffer is
 >    still below, but the windows are evenly split, i.e. the Calendar
 >    window is no longer sized to fit but is too big.  Prior to the
 >    reimplementation of display-buffer doing this step did not change the
 >    height of the Calendar window.
 >
 > The behavior in step 3 results from the invocation of
 > window--even-window-heights in the last clause of the cond in
 > display-buffer, which happens because the *Messages* buffer exits but is
 > not displayed.  If the sexp in step 3 contained *scratch* instead of
 > *Messages*, the height of the Calendar window would not have changed.

Thanks for noticing this.

 > Looking at the pre-reimplementation source of Fdisplay_buffer, it looks
 > like the window heights should get evened out just as in the lisp
 > reimplementation; nevertheless, this is not what happens in the above
 > recipe with the older code.

It's because in the Elisp code I evened window heights whenever they
were not equal.  The original code evened heights only when the height
of the window to display BUFFER-OR-NAME was less than that of the
selected window.  I've tried to restore the original behavior.  Please
try again.

I'd like to make the window code resilient in a way that applications
like calendar can naturally set `window-size-fixed'.  As a consequence,
`display-buffer' wouldn't change the calendar window's size even it were
larger than the new window.  Setting `window-size-fixed' can currently
result in unexpected behavior.  Fixing this is non-trivial.

Also I'd like to give `split-height-threshold' and `window-min-height'
buffer-local semantics and maybe add a `window-max-height' variable so
to do `fit-window-to-buffer' and `shrink-window-if-larger-than-buffer'
implicitly during each window configuration change.  `window-min-height'
equalling `window-max-height' for a particular buffer would then imply
`window-size-fixed' for that buffer.

Eventually, a user should be able to change window configurations
arbitrarily with the calendar window always keeping its original size
(unless there's no other way, obviously).

martin







^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#410: 23.0.60; display-buffer regression
  2008-06-14  9:40 ` martin rudalics
@ 2008-06-14 22:34   ` Stephen Berman
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Berman @ 2008-06-14 22:34 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: emacs-pretest-bug

On Sat, 14 Jun 2008 11:40:30 +0200 martin rudalics <rudalics@gmx.at> wrote:

>> The recent reimplementation of display-buffer in lisp resulted in the
>> following changed behavior, which I consider a regression:
>>
>> 1. emacs -Q
>>
>> 2. M-x calendar
>>    ==> The window is vertically split, the *scratch* buffer above and
>>    the Calendar buffer is below in a smaller window sized to fit.
>>
>> 3. M-: (pop-to-buffer (get-buffer "*Messages*"))
>>    ==> Now the *Messages* buffer is above and the Calendar buffer is
>>    still below, but the windows are evenly split, i.e. the Calendar
>>    window is no longer sized to fit but is too big.  Prior to the
>>    reimplementation of display-buffer doing this step did not change the
>>    height of the Calendar window.
>>
>> The behavior in step 3 results from the invocation of
>> window--even-window-heights in the last clause of the cond in
>> display-buffer, which happens because the *Messages* buffer exits but is
>> not displayed.  If the sexp in step 3 contained *scratch* instead of
>> *Messages*, the height of the Calendar window would not have changed.
>
> Thanks for noticing this.
>
>> Looking at the pre-reimplementation source of Fdisplay_buffer, it looks
>> like the window heights should get evened out just as in the lisp
>> reimplementation; nevertheless, this is not what happens in the above
>> recipe with the older code.
>
> It's because in the Elisp code I evened window heights whenever they
> were not equal.  The original code evened heights only when the height
> of the window to display BUFFER-OR-NAME was less than that of the
> selected window.  

Thanks for the explication, I didn't grasp that in my cursory perusal.

>                   I've tried to restore the original behavior.  Please
> try again.

Your patch makes display-buffer work as it previously did in cases like
the above; thanks.

Steve Berman








^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-14 22:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-13 22:04 bug#410: 23.0.60; display-buffer regression Stephen Berman
2008-06-14  9:40 ` martin rudalics
2008-06-14 22:34   ` Stephen Berman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).