unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juri Linkov <juri@linkov.net>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 55169@debbugs.gnu.org
Subject: bug#55169: Can't combine window-min-height with window-height
Date: Thu, 5 May 2022 09:47:17 +0200	[thread overview]
Message-ID: <8ae5e6ac-25f5-3feb-b05b-fbdb71e7ac1d@gmx.at> (raw)
In-Reply-To: <865ymlje5o.fsf@mail.linkov.net>

 > I didn't expect that 'split-window-sensibly' should pay attention
 > to 'window-min-height'.  I though only 'display-buffer-*' are affected.

'split-window-sensibly' is the function 'display-buffer-pop-up-window'
runs by default to make a new window.  The dilemma is the following:
'display-buffer-below-selected', before it tries to split the selected
window, asserts that

              (or (not (numberp min-height))
		 (window-sizable-p nil (- min-height)))

where 'min-height' is (cdr (assq 'window-min-height alist)).

'split-window-sensibly', however, may split off a window that is less
than 'min-height' lines high and cannot be enlarged afterwards either.
So far, this is OK because in the manual, in wise foresight, we say for
‘window-min-height’ that "The only client of this entry is presently
‘display-buffer-below-selected’".  But if we obey 'window-min-height' in
'window--display-buffer', then 'display-buffer-pop-up-window' becomes a
client of 'window-min-height' without, however, fulfilling its premise
which says that "If ALIST contains a `window-min-height' entry, this
function ensures that the window used is or can become at least as high
as specified by that entry's value.".

We obviously could call 'split-window-sensibly' with an extra ALIST
argument and have it obey the 'window-min-height' constraint.  But
'split-window-sensibly' is just the default value of the option
'split-window-preferred-function' (all these were invented some time
before 'display-buffer-alist') and that function accepts only one
argument.  So we would have to amend 'window--try-to-split-window' as

		   (or (condition-case nil
		           (funcall split-window-preferred-function window alist)
		         (error nil))
		       (condition-case nil
		           (funcall split-window-preferred-function window)
		         (error nil)))))

No great deal but spilling out the details in the manual will inevitably
increase the mythical confusion around 'display-buffer-alist'.

martin

  reply	other threads:[~2022-05-05  7:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 17:58 bug#55169: Can't combine window-min-height with window-height Juri Linkov
2022-04-29 10:27 ` Lars Ingebrigtsen
2022-04-30  8:03   ` martin rudalics
2022-05-01 17:06     ` Juri Linkov
2022-05-02  7:37       ` martin rudalics
2022-05-02 18:53         ` Juri Linkov
2022-05-03  9:21           ` martin rudalics
2022-05-03 17:38             ` Juri Linkov
2022-05-04  7:54               ` martin rudalics
2022-05-04 19:29                 ` Juri Linkov
2022-05-05  7:47                   ` martin rudalics [this message]
2022-05-05  8:03                     ` Juri Linkov
2022-05-05  9:49                       ` martin rudalics
2022-05-05 16:37                         ` Juri Linkov
2022-05-06  7:02                           ` martin rudalics
2022-05-06  7:52                             ` Juri Linkov
2022-05-06 14:10                               ` martin rudalics
2022-05-06 15:34                                 ` Juri Linkov
2022-05-07  7:58                                   ` martin rudalics
2022-05-08 18:18                                     ` Juri Linkov
2022-05-09  7:24                                       ` martin rudalics
2022-05-09  7:38                                         ` martin rudalics
2022-05-09 18:58                                         ` Juri Linkov
2022-05-10  7:41                                           ` martin rudalics
2022-05-11  7:21                                             ` Juri Linkov
2022-05-11  8:19                                               ` martin rudalics
2022-05-12 17:03                                                 ` Juri Linkov
2022-05-13  7:01                                                   ` martin rudalics
2022-05-13 16:58                                                     ` Juri Linkov
2022-05-14  7:49                                                       ` martin rudalics
2022-05-11  9:03                                           ` Richard Stallman
2022-05-12 16:59                                             ` Juri Linkov
2022-05-18 18:20                                         ` Juri Linkov
2022-05-19  7:18                                           ` martin rudalics
2022-05-19 16:27                                             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ae5e6ac-25f5-3feb-b05b-fbdb71e7ac1d@gmx.at \
    --to=rudalics@gmx.at \
    --cc=55169@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).