GNU bug report logs - #55169
Can't combine window-min-height with window-height

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 28 Apr 2022 18:04:01 UTC

Severity: normal

Full log


Message #17 received at 55169 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 55169 <at> debbugs.gnu.org
Subject: Re: bug#55169: Can't combine window-min-height with window-height
Date: Mon, 2 May 2022 09:37:46 +0200
> Maybe as a workaround two calls of display-buffer would do the trick?
> The first call display-buffer-below-selected will split the window,
> then the second call display-buffer-use-some-window will adjust the height.

There would be no benefit in doing such a thing.  The first call might
not be able to produce a window that satisfies the 'window-min-height'
constraint.

A correct solution would be to, before splitting, check whether the
split off window can be made as high as wanted.  For that, we would have
to investigate all possible splittings over all actions allowed by the
ALIST argument to check whether the emanating split would satisfy the
height constraint (where the maximum possible height of a split off
window would be the sum of the total sizes minus their minimum sizes of
all windows in the same combination as the split one).

Our current strategy to usually split just the largest or LRU window is
much too naive in this regard.  The problem with a new approach is that
we would have to tell people that when a 'window-min-height' entry is
present, the display strategy they got used to may change - the new
window might appear in a non-standard position.  Who's to blame?  The
one who bona fides added the 'window-min-height' constraint in a call or
the people who changed the semantics of 'display-buffer'?

BTW I do not understand well in which sense your original scenario

  (pop-to-buffer (generate-new-buffer "*edit string*")
                 '(display-buffer-below-selected
                   (window-min-height . 10)
                   (window-height . fit-window-to-buffer)))

fails.  Do you mean that the window should be at least ten lines high
despite of the fact that it's fit to an empty buffer?

martin




This bug report was last modified 3 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.