all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: watching for variable assignment
Date: Mon, 10 Mar 2014 18:35:45 +0800	[thread overview]
Message-ID: <87y50iibni.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87lhwicsgc.fsf@gmail.com

Jambunathan K <kjambunathan@gmail.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> 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




  parent reply	other threads:[~2014-03-10 10:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10  9:21 watching for variable assignment Eric Abrahamsen
2014-03-10  9:29 ` Jambunathan K
2014-03-10  9:59   ` Eric Abrahamsen
2014-03-10 10:00     ` Nicolas Richard
2014-03-10 10:09       ` Eric Abrahamsen
2014-03-10 10:35     ` Jambunathan K
2014-03-10 10:48       ` Jambunathan K
2014-03-10 11:23         ` Eric Abrahamsen
2014-03-10 10:54       ` Eric Abrahamsen
2014-03-10 11:08         ` Jambunathan K
2014-03-10 11:38           ` Jambunathan K
2014-03-10 10:35   ` Eric Abrahamsen [this message]
2014-03-10 13:06     ` Stefan Monnier
2014-03-21 10:26       ` Eric Abrahamsen
2014-03-21 12:21         ` Stefan
2014-03-10 19:56     ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y50iibni.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.