emacs-devel
[Top][All Lists]
Advanced

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

Re: Setting global variables (was: About zcomplete)


From: Ergus
Subject: Re: Setting global variables (was: About zcomplete)
Date: Mon, 21 Feb 2022 17:57:15 +0100

On Mon, Feb 21, 2022 at 10:35:43AM -0500, Stefan Monnier wrote:
I guess this is only of the issue that is so easy to solve on a
case-by-case basis (e.g. by setting a symbol property) that nobody has
bothered to write a general solution (e.g. by adding a keyword to
define-minor-mode that specifies what variables/user options to set when
enabled).

FWIW, I've been toying with the idea of adding a kind of "advice"
mechanism for variables.

Basically associate with every variable a base value and a list of
functions that modify it.  Then minor modes can add a function to the
list (which would implicitly update the var's effective value) when
enabled and then remove it afterwards.


       Stefan

This actually sounds very interesting... Maybe you could suggest it in
#54074 ...

My idea was actually to have an interface like the one of use-packages
in define-minor mode... for customs (vars), hooks and bindings... so
disabling the mode automatically restores the variables, removes the
hooks and cleans the bindings... But in the background either your
proposal or Juri's looks fine...


reply via email to

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