emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Run hook when variable is set


From: Stefan Monnier
Subject: Re: [PATCH] Run hook when variable is set
Date: Fri, 30 Jan 2015 10:55:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> You mean something like setq-with-hook, which you can use in place of setq?
> Then in general, you also need set-with-hook, setq-default-with-hook,
> set-default-with-hook, setq-local-with-hook, and let-with-hook. That
> seems cumbersome.

Yes, you can make it cumbersome if you want.  Or you can drop the
let-with-hook since it would be a misfeature anyway, and then
consolidate the remaining 4 into a single function.

You'd probably want a second function which does the "read value with
hook", OTOH.

> In summary:
> cursor-type can be changed buffer-locally, which doesn't affect other
> buffers or the global setting. Therefore dynamic-cursor-mode must be
> disabled in the same buffer, but not in other buffers or globally.

The code I provided disables the effect of dynamic-cursor-mode as soon
as the value of cursor-type is not the expected one (without
needing to disable dynamic-cursor-mode).  So AFAICT the problem
doesn't exist.


        Stefan



reply via email to

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