Subject: Re: bug#44483: 27.1.50; Window parameter `min-margins' doesn't split window in half

From: martin rudalics <[email-masked]>
Date: Sat, 7 Nov 2020 10:00:11 +0100

>> The problem is that when we split the original window, the new window
 >> does not get its 'min-margins' parameter set and the subsequent
 >> sanitizing step screws up things.  Please try the attached patch.
 >
 > Yes, the patch appears to work. After applying it, splitting a window gives me a
 > 50/50 split. (I tried several times.)

I installed a slightly different fix on the Emacs 27 branch now.  We
really should have had tested 'min-margins' when Emacs 25 came out but
IIRC you bowed out in the last minute back then and apparently now you
have become their first client.  Since the bug shows up only when SIZE
is unspecified, the recipe I used might not have triggered it then.

In Emacs 28 I intend to remove sanity checks entirely and always
auto-shrink margins when they don't fit into a window any more.  Windows
will also have a configurable minimum body width so the behavior seen
now where the entire buffer text disappears can be easily avoided.

 >> And please look also into what happens when you shrink a frame with such
 >> large margins to a size that won't accommodate those margins any more
 >> unless they get shrunk.  I'm afraid that the subsequent sanitizing step
 >> might cause troubles there as well.
 >
 > I'm not seeing anything unexpected here, but I'm not sure what I should be
 > looking at.

In an earlier posting you said that "Twice during my tests Emacs
actually hung, driving one of the CPU cores to 100%."  I thought of
something similar happening when shrinking a frame.

martin