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: Fri, 21 Mar 2014 18:26:01 +0800	[thread overview]
Message-ID: <874n2rhmpy.fsf@ericabrahamsen.net> (raw)
In-Reply-To: jwv61nmcj6e.fsf-monnier+gmane.emacs.help@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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!
>
> FWIW, I think I'd accept a patch which adds support for "watchers" on
> symbols (by extending the read-only bit to 2 bits, so we can
> distinguish a "really read-only symbol" from a "symbol with watchers").
>
>> 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.
>
> No, you can't advise special forms (and even if you changed nadvice.el to
> try and support it, it still wouldn't apply to byte-compiled code).
>
>> 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 you point to the offending documentation (it's still in the process
> of being written, so it would be helpful).
> I don't see any "setf-able" anywhere, but FWIW such a thing is also
> called "an lvalue" in other languages.

I saw "Generalized Variable" in the first paragraph, and in my brain I
conflate "generalized variable" with "setf-able place", probably
incorrectly.

FWIW, I updated git emacs recently. The docs seem to have been greatly
expanded, and now make a lot of sense.

E




  reply	other threads:[~2014-03-21 10:26 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
2014-03-10 13:06     ` Stefan Monnier
2014-03-21 10:26       ` Eric Abrahamsen [this message]
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=874n2rhmpy.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.