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

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

Re: Catching redefinitions


From: Elena
Subject: Re: Catching redefinitions
Date: Sun, 28 Nov 2010 06:48:19 -0800 (PST)
User-agent: G2/1.0

On Nov 28, 3:15 pm, "Pascal J. Bourguignon" <p...@informatimago.com>
wrote:
> Elena <egarr...@gmail.com> writes:
> > On Nov 28, 11:12 am, Elena <egarr...@gmail.com> wrote:
> >> I've tried:
>
> >> (setq sym val &rest rest)
>
> >> but Emacs does not like it either.
>
> > That is, I've tried this function argument list into "defadvice":
>
> > (sym val &rest rest)
>
> > However, I think "setq" is too basic a function to be redefined
> > without falling into some infinite loop.
>
> Indeed, the point was that:
>
>    setq is a special form in `C source code'.
>
> that means that advices won't be called, when this special form is
> called from C code, or from compiled emacs lisp code.

Thank you for your explanation, Pascal.

Well, this would not be an issue, since such advices I'm trying to
implement would only serve the purpose of tracking accesses to
variables from third-party packages (loaded in source-code form).
However, it seems the prototype of "setq" can't be passed to
"defadvice".

Regarding the issue of infinite recursion caused by advising "setq",
it could be avoided by means of a boolean flag.


reply via email to

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