Subject: bug#32825: 27.0.50; Deterministic window management

From: Juri Linkov <[email-masked]>
Date: Wed, 31 Oct 2018 23:10:54 +0200

>> I still don't understand why it's impossible to support such uses?
>>
>> diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
>> index 7fc2b41c70..6d72616dbc 100644
>> --- a/lisp/emacs-lisp/debug.el
>> +++ b/lisp/emacs-lisp/debug.el
>> @@ -239,11 +239,13 @@ debug
>>   	      (pop-to-buffer
>>   	       debugger-buffer
>>   	       `((display-buffer-reuse-window
>> -		  display-buffer-in-previous-window)
>> -		 . (,(when (and (window-live-p debugger-previous-window)
>> -				(frame-visible-p
>> -				 (window-frame debugger-previous-window)))
>> -		       `(previous-window . ,debugger-previous-window)))))
>> +		  display-buffer-in-previous-window
>> +		  display-buffer-below-selected)
>> +		 . ((window-min-height . 10)
>
> What would the semantics of that 'window-min-height' entry be?
>
> (1) When splitting a window, the new window must be at least 10 lines
>     high.
>
> (2) When splitting a window, both the old and the new window must be
>     at least 10 lines high after the split.
>
> (3) When splitting a window, every window must be at least 10 lines
>     high after the split.
>
> And what would we do if before the split a window is less high than 10
> lines?

I think the semantics should be:

(4) If the height of the new window will be less than 10 lines specified
    by window-min-height, then display the buffer a window below
    from the selected window.

IIUC, currently 'window-min-height' with the default of 4 lines works like this?

> Why can't we just follow the doc-string of 'window-min-height'?
>
>    Applications should never rebind this variable.  To resize a
>    window to a height less than the one specified here, an
>    application should instead call ‘window-resize’ with a non-nil
>    IGNORE argument.  In order to have ‘split-window’ make a window
>    shorter, explicitly specify the SIZE argument of that function.

How then the code will look like?  I guess it will be quite complex
and not declarative.