[Top][All Lists]

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

Re: PATCH: make linum.el play nicely with other margin-setting extension

From: martin rudalics
Subject: Re: PATCH: make linum.el play nicely with other margin-setting extensions
Date: Sat, 14 Nov 2015 09:27:55 +0100

>> But wasn't the problem that darkroom should respect the minimum width of
>> ‘linum-mode’ and vice-versa?  How would "owning" fit into this?
> Yes. Did you see the example implementation, which provides the example
> you request?

If you have a "noisy" owner like ‘linum-mode’ that recalculates margin
widths every redisplay cycle, things are easy.  But with a "quiet" owner
that establishes a preferred margin width once only when it gets
started, things are not that easy.  You would have to wake such modes up
somehow every time an owner resigns.

>> This "before" is problematic when a second or third mode kicks in after
>> an owner has set its preferred size.
> But then it's those other modes that need to be fixed, to follow
> whatever their policy is regarding overwriting current settings. Just
> like linum.el does in its `linum-update-window'.

If ‘linum-mode’ prevails what should those other modes do?

> The policy there is: "make just the space I need. If I need to change to
> change the margins, then I own them, and it's my responsibility to reset
> them to what they were before unless someone else takes that
> responsibility from me".

This would work if we assume some stacking order on how modes set up
margins.  In practice there might be no such order.

>> And how do we decide prioritization when the "owner" is deactivated and
>> there are two or more contenders?
> We don't. Up to the package. Every package has its policy and can decide
> to take ownership. A good policy for taking ownership is "I needed to
> change it, I take ownership, so I can check later if I should revert
> it". But there might be other cases

The problem is not that of taking ownership.  It's that of what to do
when "I should revert it".


reply via email to

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