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

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 16 Aug 2021 17:40:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
19711: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19711
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#19711: 25.0.50; (ad-is-adviced sym) is inconsistent with (advice--p (advice--symbol-function sym))
From: Stefan Monnier <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked], Oleh Krehel <[email-masked]>
Date: Mon, 16 Aug 2021 13:39:31 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> I think this was basically fixed by:
>
> commit 6e2d6d54e1236216462c13655ea1fe573d9672e7
> Author:     Stefan Monnier <[email-masked]>
> AuthorDate: Fri Jul 14 11:27:21 2017 -0400

Agreed, closing,

        Stefan

Subject: 25.0.50; (ad-is-adviced sym) is inconsistent with (advice--p (advice--symbol-function sym))
From: Oleh Krehel <[email-masked]>
To: [email-masked]
Date: Wed, 28 Jan 2015 14:55:01 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

`ad-is-adviced' 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).

On the other hand, this code from `advice-remove' will work:

    (advice--p (advice--symbol-function 'foo))

To summarize, functions instrumented by elp aren't recognized as adviced
by `ad-is-advised', even though :around advice: even shows up in the
docstring.

A fix could be to change `ad-is-adviced' to expand to either

    (or (get 'foo 'ad-advice-info)
        (get 'foo 'elp-info))

or

    (advice--p (advice--symbol-function 'foo))