emacs-devel
[Top][All Lists]
Advanced

[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: João Távora
Subject: Re: PATCH: make linum.el play nicely with other margin-setting extensions
Date: Sat, 14 Nov 2015 19:55:57 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin)

martin rudalics <address@hidden> writes:

> If you have a "noisy" owner like ‘linum-mode’ that recalculates margin
> widths every redisplay cycle, things are easy.

Sure, but notice that my basic scheme makes linum-mode work even with
ignorant modes like darkroom.el.

> 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.

We could wake it up. Or we could patch the other ignorant modes to
follow some ownership-aware logic, perhaps saving what they " found" for
later restoration.

I'm just trying to enable that some modes can follow certain policies
that play slightly more nicely with other modes that have no policy at
all. As more modes have at least some kind ownership-aware policy, we
get better interoperation.

But to allow even this minimalist approach even possible there has to be
some primitive support in Emacs, and that's what I'm proposing. (It
doesn't have to be called "setting owner", by the way, if the subpar
name is what's holding you back).

A more sophisticated API could (probably after a lengthy discussion and
analysis) bring us farther, and can be made compatible to the
"minimalist" scheme I'm proposing. We can certainly start that
discussion: for instance, perhaps this could work.

(defun set-and-own-setting (owner setting object args-fn)
 "whereby ARGS-FN is called the first time to provide args for
  OBJECT'S SETTING and all subsequent time when ownership changes.
  If ARGS-FN returns nil, it means that OWNER relinquishes
  ownership."
  ...)

(defun revert-to-previous-setting (owner setting object)
  "whereby OWNER relinquishes ownership of OBJECT's SETTING
  and SETTING is reverted to the previous owner.")

João






reply via email to

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