emacs-devel
[Top][All Lists]
Advanced

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

Re: Window splitting issues with margins


From: Joost Kremers
Subject: Re: Window splitting issues with margins
Date: Sat, 14 Nov 2015 21:34:09 +0100
User-agent: mu4e 0.9.13; emacs 24.5.50.1

On Fr, Nov 13 2015, Eli Zaretskii <address@hidden> wrote:
>> Date: Fri, 13 Nov 2015 09:04:54 +0100
>> From: martin rudalics <address@hidden>
>> Cc: address@hidden
>> 
>>  > Except that I don't know if any other package is also using the margin
>>  > and should perhaps assume a minimum width larger than 0. Right now,
>>  > visual-fill-column will happily set the margin to 0 if the window width
>>  > is smaller than the requested text width.
>> 
>> The question is whether it makes any sense for two packages to ever
>> share one and the same margin.  I doubt that.

Well, linum-mode uses the margins to display line numbers and both
writeroom-mode and darkroom-mode use them to center the text in a wide
window. Personally, I don't use both modes at the same time (I use
writeroom-mode when writing text, linum-mode to me only seems useful in
programming), but there are apparently users who would like to use both
at the same time. Which currently is not possible.

> I agree.  Making the display margins shareable is a tough nut, it will
> most probably require introduction of quite a few new functions that
> every user of the margins will have to consult.  If the only use case
> that needs that is these two modes,

For the moment, it seems so, yes, but who knows what uses for the
margins future packages come up with?

> and if their problem is only with
> splitting the window, let's instead try to solve that on the
> window-splittable-p level.

Actually, that's not the only problem. Just activating both linum-mode
and writeroom-mode in a single buffer is already problematic, because
linum-mode doesn't take the possibility into consideration that some
other package might have set the left margin to a value > 0.
writeroom-mode will do the same, BTW.

The window-splittable issue has nothing to do with linum-mode, it's just
a writeroom-mode issue.

It's just that I think both issues could be solved by the same
mechanism: allowing a (minor) mode to lock the margins to a certain
minimum width. window-splittable-p could then assume that those parts of
the margins that are not locked can be reduced along with the text area,
unlike now, where the underlying assumption seems to be that if the
margins are > 0, there's probably a reason for it and they shouldn't be
reduced.

At the same time, it would allow linum-mode and writeroom-mode to play
nice together: instead of setting the margin to the size it requires for
line numbers, linum-mode could set a minimum size, allowing other
packages to make them wider. writeroom-mode then would not be allowed to
set margins to less than the minimum size.

I'm not familiar with Emacs internals, so I can't say how difficult
something like this would be to implement or if it's really the best
method. It's also more of a "would be nice to have" rather than a "must
have" and it might be more trouble than it's worth. But still, it would
be nice to have. ;-)

-- 
Joost Kremers
Life has its moments



reply via email to

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