GNU bug report logs - #22009
Inconsistent handling of window splitting with margins

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Wed, 25 Nov 2015 13:08:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Joost Kremers <joostkremers <at> fastmail.fm>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22009 <at> debbugs.gnu.org
Subject: bug#22009: PATCH: Use `window-total-width' in `window-splittable-p'
Date: Tue, 01 Dec 2015 13:59:36 +0100
On Fr, Nov 27 2015, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Joost Kremers <joostkremers <at> fastmail.fm>
>> Date: Fri, 27 Nov 2015 02:16:22 +0100
>> 
>> The problem I'd like to solve (and the reason I submitted the patch) is
>> that if a window has wide margins that are used to center the text,
>> `window-splittable-p' will say that the window cannot be split
>> horizontally, even though it can, because the margins are disposable.
>> 
>> But actually, that's not the real problem. The real problem is that
>> `window-splittable-p' simply has too little information to make an
>> informed decision.
>> 
>> The point is that the margins may be used for two different kinds of
>> purposes:
>> 
>> (1) The margins can be used to display useful information, in which case
>> they should be retained when the window is split.
>> 
>> (2) The margins can be used to reduce the width of the text area. In
>> this case, the margins are disposable.
>
> There's one more factor here: whether the margins will remain at their
> width after splitting.

Yes, that is the actual issue. The point is that the way the margins are
used determines whether they must remain at their width after splitting
or not.

>  The mode which you presented and where the
> current behavior was a problem changed the margins width as result of
> the split (AFAIU),

Yes, you understand correctly.

> which is something the split decision cannot
> possibly know.

As things stand, no.

>  So I don't see how we could solve the problem even in
> principle if we want to handle such modes correctly.

By keeping track of which modes set the margins and whether they can be
reduced in case of a window split or not, as discussed in the thread on
emacs-devel.

> The only way is
> to ask the modes themselves, or provide a hook for them to override
> the decision.

I'm not sure that would be able to handle cases where different modes
use the margins for different purposes.


-- 
Joost Kremers
Life has its moments




This bug report was last modified 4 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.