[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Better handling of window margins

From: Eli Zaretskii
Subject: Re: Better handling of window margins
Date: Fri, 04 Dec 2015 17:34:07 +0200

> Date: Fri, 04 Dec 2015 11:21:22 +0100
> From: martin rudalics <address@hidden>
> CC: address@hidden, address@hidden
>  > And how will this help in deciding how to split a window, when you
>  > cannot predict how the margins will change (or _whether_ they will
>  > change) as result of the split?
> We never can predict such things.  For ‘linum-mode’ the display-width of
> a window's margin will change when you show another buffer in that
> window and that other buffer has 10000 lines and the buffer you showed
> before has 5.
> If ‘split-window’ is supposed to show the buffer of the original window,
> the display-width of the margin is not supposed to change.  And that's
> everything ‘split-window’ can care about.  If we are going to display
> another buffer in the new window, all bets are off.

I agree.  But if we only care about showing the same buffer case, then
we do really need to consider only the width of the text area when we
decide whether to split horizontally or vertically, right?  Moreover,
even when another buffer is shown in one of the two windows, the
window that continues to display the original buffer should still have
reasonable width of its text area, right?  And the only way to
guarantee the latter is to consider the width of only the text area,
excluding the margins.

>  > We are still talking about splitting windows here, right?
> And about resizing windows, right?

I wasn't aware that resizing windows was part of the use cases
considered by this discussion.  How is it relevant?  What decisions
during resizing depend on the margins?

>  > OK, but how does this lead to "modes will also have to intervene every
>  > time we set a window's fringes" part?
> Because the decision whether we can enlarge the fringes of a window is
> also based on the size of the window's margins (see set_window_fringes).

You mean, when the window is so thin that it cannot allow to be any
thinner?  Yes, but that's a marginal (pun intended) use case.  By
contrast, splitting a window with margins is not.

> So if a mode should be allowed to affect the behavior of ‘split-window’
> based on how it wants its margins to behave in the old or new window, it
> should be also allowed to affect the behavior of ‘set-window-fringes’,
> for example, by reducing the margin-width when enlarging a fringe.

Maybe so, but that's much less important, IMO.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]