Subject: bug#22009: PATCH: Use `window-total-width' in `window-splittable-p'

From: martin rudalics <[email-masked]>
Date: Fri, 27 Nov 2015 09:27:39 +0100

> Maybe we should step back and recall what problem are we trying to
 > solve with the proposed patch, then.

The current code is inherently wrong because it treats height and width
differently.  And it's not about the margins alone but also about
fringes, scroll bars and dividers.  But this is a very old inconsistency
and I never worried to much about it.  Joost uncovered it.

 >> If you mean that a mode introducing large margins should override
 >> ‘split-window-sensibly’ then this is not TRT.  ‘split-window-sensibly’
 >> is user territory and ‘window-splittable-p’ too.
 >
 > Didn't you just tell they are called by display-buffer?  How's that
 > "user territory"?

The option ‘split-window-preferred-function’ is by default set to
‘split-window-sensibly’.  It's exclusively in the hand of the user to
change that.  A mode that wants to change whether and how
‘display-buffer’ is supposed to split a window should specify its own
buffer display action in the call to ‘display-buffer’.

It would be more correct to rename

‘split-window-preferred-function’ -> ‘display-buffer-split-window-preferred-function’

‘split-window-sensibly’ -> ‘display-buffer-split-window-sensibly’

‘window-splittable-p’ -> ‘display-buffer-window-splittable-p’

in order to avoid the misunderstandings we have here.  But this is
clumsy.  Suggestions welcome.

martin