help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: watching for variable assignment


From: Eric Abrahamsen
Subject: Re: watching for variable assignment
Date: Mon, 10 Mar 2014 18:35:45 +0800
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3 (gnu/linux)

Jambunathan K <address@hidden> writes:

> Eric Abrahamsen <address@hidden> writes:
>
>> I'm trying to somehow trigger a message or a backtrace whenever that
>> variable's value changes.
>
>
> You are looking for a "Write Breakpoint".  I haven't done much Elisp
> debugging.  Going by the docs, the following looks promising.
>
>     (info "(elisp) Global Break Condition")

No, this isn't going to work -- the only way I could find the code
that's resetting the variable would be to instrument it directly, which
would require knowing which code it was in the first place. Not much
use!

I've got git emacs installed on my system, and I think the newer version
of advising functions might work better. I'm hoping that if I add a
function to "setq" with the :before key, I can avoid the infinite loop
problem.

I read the manual, and found it pretty unhelpful on the question of how
to tell it what function you're actually trying to advise. A "setf-able
place" doesn't mean much to me when I'm just trying to hijack "setq" and
check its args.

Can someone illustrate for me the (I'd hope fairly simple) case of
adding a function :before "setq", and checking if its first argument is
"nnimap-split-fancy"? The possibility that's it's a longer setq form
with multiple arguments is one I'll consider after I've got the basic
shape down...

Thanks!
Eric




reply via email to

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