Subject: Re: bug#18390: 24.4.50; REGRESSION: `split-window' error

From: Eli Zaretskii <[email-masked]>
Date: Sat, 01 Oct 2016 18:44:50 +0300

> Date: Sat, 1 Oct 2016 14:01:44 +0100
> From: Alan Third <[email-masked]>
> Cc: Drew Adams <[email-masked]>, [email-masked]
> 
> On Sat, Oct 01, 2016 at 10:44:46AM +0300, Eli Zaretskii wrote:
> > The backtrace shows that this is the reason for signaling the error:
> > 
> >   split-window(#<window 8 on Palette (Hue x Saturation)> 100 t)
> > 
> > This requests to split an 80-column window while leaving the original
> > window 100 columns, which is clearly impossible.  So why is this a
> > bug in Emacs and not in palette.el?
> 
> I can’t see how you know it’s an 80 column window, could you explain
> it to me?

The default width of an Emacs window displayed by "emacs -Q" is 80
columns.  And that is the width of a window I see when I repeat Drew's
recipe and get the same error signaled as in his report.

> Looking at the code in palette.el, it requests a 115 character wide
> frame, is it possible that Emacs will return a smaller than requested
> frame?

I don't really know what palette.el is doing, but it could be that it
doesn't let the Emacs frame time to resize itself before splitting the
window.

In any case, I once again ask the question: why should we assume it's
a bug in Emacs, and not first try looking into what palette.el does?

> 
>     (make-frame
>          `((menu-bar-lines . 0) (tool-bar-lines . 0) (left-fringe . 0) (right-fringe . 0)
>            (fringe . 0) (height . 100) (width . 115) (minibuffer) (vertical-scroll-bars)
>            (cursor-type . box) (background-color . "Black") (mouse-color . "Black")
>            (cursor-color . "Black") ,(cons 'font palette-font)))
> 
> If it is then it’s up to palette.el to check what size of frame it
> actually got back before trying to split the windows.

Actually, adding a (sit-for 0) might be all that's needed, if this is
the problem (which I'm not at all sure).