Subject: Re: bug#3984

From: Stefan Monnier <[email-masked]>
Date: Tue, 17 Sep 2013 21:46:46 -0400

>>> We have "ad-is-advised" which we can use to find which stack frames
>>> correspond to advised functions. We have "ad-get-orig-definition" which we
>>> can use to find the original definition of an advised function.
>> These are functions of advice.el, which is on the way out.  We need to
>> look at nadvice.el.
> Wait, so defadvice and friends are going away entirely?

It's very widely used, so it'll be around for a long while.  It's not
even marked obsolete officially yet.  But it is functionally obsoleted
by nadvice.

> Is everything in advice.el going away, or are some parts of it going
> to be converted to the new advice system?

It's already been changed to work on top of nadvice.el.

> Is all this documented somewhere?

No, only the internals were changed, and they're usually not documented,
other than in the form of actual code, and a few comments when you're lucky.

> I tried the before advice, and it doesn't seem to work. With the following
> code in emacs -Q:
> (advice-add 'call-interactively :before #'ignore)
> (defun myfun2 ()
>   (interactive)
>   (or (called-interactively-p)
>       (error "Must be interactive!")))
> (call-interactively 'myfun2)
> I get the following stack trace:

Hmm, indeed, that fails already.  It shouldn't be too hard to make
it work, tho.

        Stefan