Detect when variable changes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect when variable changes

Joe Riel
Is there a way to detect when a variable changes?
Specifically, the buffer-local variable default-directory
is changing at some point and I'd like to detect
what code is doing that.

--
Joe Riel


Reply | Threaded
Open this post in threaded view
|

Re: Detect when variable changes

Eli Zaretskii
> Date: Wed, 4 Oct 2017 11:57:18 -0700
> From: Joe Riel <[hidden email]>
>
> Is there a way to detect when a variable changes?

Emacs 26 has a watchpoint-like facility which you could use for that.