Subject: Re: bug#24193: 25.1; `window-min-size' fails for horizontal width when margins >= body text

From: Eli Zaretskii <[email-masked]>
Date: Tue, 09 Aug 2016 17:56:42 +0300

> From: Paul Rankin <[email-masked]>
> Date: Tue, 09 Aug 2016 19:14:27 +1000
> 
> There appears to be a change to `window-min-size' that gives an erroneously large minimum horizontal window size when the combined size of window margins exceed that of the body text, e.g. in a frame 80 columns wide, with left margin 20 columns and right margin 20 columns, would return a minimum horizontal size of 42, when body text would be 40. This causes `split-window-right' to fail.
> 
> To reproduce:
> 
> 1. emacs -Q
> 2. in a frame 80 columns wide...
> 3. M-: (set-window-margins nil 20 20)
> 4. C-x 3
>     => "Window #<window 1 on *scratch*> too small for splitting (2)"
> 5. M-: (window-min-size nil t)
>     => 42
> 
> Expected results:
> 
> Window should split horizontally. Minimum window width should not be dictated by margin width.
> 
> Actual results:
> 
> Margin width dictates minimum window width and prevents window splitting.

I don't think I understand what exactly you expected to happen.  In
"emacs -Q" with no margins, "C-x 3" produces 2 windows: one that is
38-column wide, the other 37-column wide.  Since you requested 2
20-column margins, they alone need 40 columns.  How can Emacs produce
a window with such margins out of 38 columns it has at its disposal?
That isn't enough even for the margins, let alone the text area.

In such a situation, I think refusing to split is a reasonable
response: the user asked for something that is not doable.  What
alternative behavior did you expect?

Thanks.