Subject: bug#19711: 25.0.50; (ad-is-adviced sym) is inconsistent with (advice--p (advice--symbol-function sym))

From: Oleh Krehel <[email-masked]>
Date: Wed, 28 Jan 2015 21:07:36 +0100

On Wed, Jan 28, 2015 at 8:55 PM, Stefan Monnier
<[email-masked]> wrote:
>> `ad-is-advised' expands to:
>>     (get 'foo 'ad-advice-info)
>> This code will not detect if the function `foo' is being instrumented
>> with `elp-instrument-package' (which is a form of advice).
>
> That's because ad-is-advised tells you "is there a "defadvice" on this
> function" rather than "is there some kind of advice-like thingy on this
> function".
> Since this is used by advice.el internally, changing it might just break
> advice.el.

I'm mainly interested in this application:

    (help-function-arglist
     (if (ad-is-advised fun)
         (ad-get-orig-definition fun)
       fun)
     t)

I can't get the original arguments of FUN if it's adviced
(instrumented also falls here), so I'd like to detect if it is.
If `ad-is-advised` isn't enough, what other (public) function could I use?