bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#32825: 27.0.50; Deterministic window management


From: martin rudalics
Subject: bug#32825: 27.0.50; Deterministic window management
Date: Wed, 05 Dec 2018 19:55:53 +0100

> In the attached two functions I renamed it to 'window-min-height' to
> make it more consistent with 'window-height'.  Please have a look.

Please do not have a look at that.  It does things it shouldn't do;
ignoring OT1H and messing up OTOH the 'quit-restore' parameter of the
(re-)used window.

Please try the now attached version of 'display-buffer-below-selected'
instead.  The idea is that when you call

(display-buffer-below-selected BUFFER '((window-min-height . 40)))

it makes sure that the window used has at least 40 lines or can be
resized to 40 lines at least.  To really make the window 40 lines tall
you have to use 'window-height' too, like

(display-buffer-below-selected
  BUFFER '((window-min-height . 40) (window-height . 40)))

Obviously, 'window-height' may have a different value than 40 and
'display-buffer' will then try to use that value if it is allowed to
do so.  This means that

(display-buffer-below-selected
  BUFFER '((window-min-height . 40) (window-height . 20)))

may fail if the window can be made 20 lines tall but not 40.  But if
the window can be made 40 lines tall 'display-buffer-below-selected'
will try to make it 20 lines tall.  OTOH

(display-buffer-below-selected
  BUFFER '((window-min-height . 40) (window-height . 60)))

will fail only if no 40 line tall window can be found or made.  If
subsequent resizing to 60 lines fails, the window will stick to the
preexisting height (which can be the result of a split).

Is that all sufficiently comprehensible and coherent?

martin

Attachment: display-buffer-below-selected.el
Description: application/emacs-lisp


reply via email to

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