GNU bug report logs - #19711
25.0.50; (ad-is-adviced sym) is inconsistent with (advice--p (advice--symbol-function sym))

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Oleh Krehel <ohwoeowho@HIDDEN>; dated Wed, 28 Jan 2015 13:59:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 19711 <at> debbugs.gnu.org:


Received: (at 19711) by debbugs.gnu.org; 28 Jan 2015 21:47:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 28 16:47:00 2015
Received: from localhost ([127.0.0.1]:56750 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YGaRw-0002IB-AD
	for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 16:47:00 -0500
Received: from mercure.iro.umontreal.ca ([132.204.24.67]:35247)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1YGaRs-0002Hz-TH
 for 19711 <at> debbugs.gnu.org; Wed, 28 Jan 2015 16:46:57 -0500
Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca
 [132.204.27.50])
 by mercure.iro.umontreal.ca (Postfix) with ESMTP id CAB2A85D8C;
 Wed, 28 Jan 2015 16:46:55 -0500 (EST)
Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca
 [132.204.27.242])
 by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 097ED1E5B8B;
 Wed, 28 Jan 2015 16:46:33 -0500 (EST)
Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848)
 id D79F1B4102; Wed, 28 Jan 2015 16:46:32 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Oleh Krehel <ohwoeowho@HIDDEN>
Subject: Re: bug#19711: 25.0.50;
 (ad-is-adviced sym) is inconsistent with (advice--p
 (advice--symbol-function sym))
Message-ID: <jwvmw52mvjs.fsf-monnier+emacsbugs@HIDDEN>
References: <87y4on57t6.fsf@HIDDEN>
 <jwvegqeof6i.fsf-monnier+emacsbugs@HIDDEN>
 <CAA01p3opGGMD5a_dpq5Ay7KkenQ1PykQt-MEE_fq76jq1PhwNw@HIDDEN>
Date: Wed, 28 Jan 2015 16:46:32 -0500
In-Reply-To: <CAA01p3opGGMD5a_dpq5Ay7KkenQ1PykQt-MEE_fq76jq1PhwNw@HIDDEN>
 (Oleh Krehel's message of "Wed, 28 Jan 2015 21:07:36 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-DIRO-MailScanner-Information: Please contact the ISP for more information
X-DIRO-MailScanner: Found to be clean
X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel,
 SpamAssassin (score=-2.82, requis 5, autolearn=not spam,
 ALL_TRUSTED -2.82, MC_TSTLAST 0.00)
X-DIRO-MailScanner-From: monnier@HIDDEN
X-Spam-Status: No
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 19711
Cc: 19711 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

> I'm mainly interested in this application:

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

Ah, I think this is just a bug of help-function-arglist: it should
automatically peel off any advice and look for the arglist of the
unadvised function instead.

> If `ad-is-advised` isn't enough, what other (public) function could I use?

Good question.  I think currently all the functions that could help come
with a "--".


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19711; Package emacs. Full text available.

Message received at 19711 <at> debbugs.gnu.org:


Received: (at 19711) by debbugs.gnu.org; 28 Jan 2015 20:07:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 28 15:07:44 2015
Received: from localhost ([127.0.0.1]:59272 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YGYts-0007Ju-Cm
	for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 15:07:44 -0500
Received: from mail-wi0-f174.google.com ([209.85.212.174]:34091)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGYtq-0007Ji-Pb
 for 19711 <at> debbugs.gnu.org; Wed, 28 Jan 2015 15:07:43 -0500
Received: by mail-wi0-f174.google.com with SMTP id n3so14531832wiv.1
 for <19711 <at> debbugs.gnu.org>; Wed, 28 Jan 2015 12:07:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=Iq1lt6G1jIqTdF56zmu5Hai7zak4rcRQI2UsemooLK8=;
 b=IdaCZ/MwU9JIhqps4HlH16mqp+vN3q0yoMK6H0taiHMeyZ9RiYz0Y5/ThFhI7qPo33
 +/NYocwjjL6m3GUGoocIzJog+pYNJr1uxBN8Sy6UrIu3NaSHiygWn5XVIvWplVcdfTRw
 ppVsQ6qtAGJ5KSawImwXnBvqPwcSq1xhIXQLznD0RdhOKUxPAa+oFqWBnKnmLPsKSaPK
 hss/dyeCTLuDfpboHuEojzJ33Bh5E8Y17q5Td5VrZjRTniIajYJjC1awE93y96ZF8Qin
 QMKqMKPumTyUHAd40ECjMr4C/JUQo64b7KPJWsaP4ynnUcFWH9PJEl69puHAyNG6T80b
 xFVw==
MIME-Version: 1.0
X-Received: by 10.194.234.2 with SMTP id ua2mr10953240wjc.40.1422475657051;
 Wed, 28 Jan 2015 12:07:37 -0800 (PST)
Received: by 10.27.137.137 with HTTP; Wed, 28 Jan 2015 12:07:36 -0800 (PST)
In-Reply-To: <jwvegqeof6i.fsf-monnier+emacsbugs@HIDDEN>
References: <87y4on57t6.fsf@HIDDEN>
 <jwvegqeof6i.fsf-monnier+emacsbugs@HIDDEN>
Date: Wed, 28 Jan 2015 21:07:36 +0100
Message-ID: <CAA01p3opGGMD5a_dpq5Ay7KkenQ1PykQt-MEE_fq76jq1PhwNw@HIDDEN>
Subject: Re: bug#19711: 25.0.50; (ad-is-adviced sym) is inconsistent with
 (advice--p (advice--symbol-function sym))
From: Oleh Krehel <ohwoeowho@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19711
Cc: 19711 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On Wed, Jan 28, 2015 at 8:55 PM, Stefan Monnier
<monnier@HIDDEN> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19711; Package emacs. Full text available.

Message received at 19711 <at> debbugs.gnu.org:


Received: (at 19711) by debbugs.gnu.org; 28 Jan 2015 19:55:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 28 14:55:48 2015
Received: from localhost ([127.0.0.1]:59268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YGYiK-00071P-41
	for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 14:55:48 -0500
Received: from mercure.iro.umontreal.ca ([132.204.24.67]:57508)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1YGYiH-00071F-PN
 for 19711 <at> debbugs.gnu.org; Wed, 28 Jan 2015 14:55:46 -0500
Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca
 [132.204.27.50])
 by mercure.iro.umontreal.ca (Postfix) with ESMTP id 89D3785E9E;
 Wed, 28 Jan 2015 14:55:44 -0500 (EST)
Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca
 [132.204.27.242])
 by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7F4301E5B8D;
 Wed, 28 Jan 2015 14:55:19 -0500 (EST)
Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848)
 id 637ABB4102; Wed, 28 Jan 2015 14:55:19 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Oleh Krehel <ohwoeowho@HIDDEN>
Subject: Re: bug#19711: 25.0.50;
 (ad-is-adviced sym) is inconsistent with (advice--p
 (advice--symbol-function sym))
Message-ID: <jwvegqeof6i.fsf-monnier+emacsbugs@HIDDEN>
References: <87y4on57t6.fsf@HIDDEN>
Date: Wed, 28 Jan 2015 14:55:19 -0500
In-Reply-To: <87y4on57t6.fsf@HIDDEN> (Oleh Krehel's message of "Wed, 28 Jan
 2015 14:55:01 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-DIRO-MailScanner-Information: Please contact the ISP for more information
X-DIRO-MailScanner: Found to be clean
X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel,
 SpamAssassin (score=-2.82, requis 5, autolearn=not spam,
 ALL_TRUSTED -2.82, MC_TSTLAST 0.00)
X-DIRO-MailScanner-From: monnier@HIDDEN
X-Spam-Status: No
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 19711
Cc: 19711 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

> `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.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19711; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jan 2015 13:58:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 28 08:58:56 2015
Received: from localhost ([127.0.0.1]:58592 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YGT8x-0004fm-Cf
	for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 08:58:56 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41026)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGT8s-0004fU-BR
 for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 08:58:50 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGT8m-0000YW-83
 for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 08:58:44 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:44975)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGT8m-0000YS-59
 for submit <at> debbugs.gnu.org; Wed, 28 Jan 2015 08:58:44 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42745)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGT8l-0002F1-C2
 for bug-gnu-emacs@HIDDEN; Wed, 28 Jan 2015 08:58:44 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGT8g-0000Wz-90
 for bug-gnu-emacs@HIDDEN; Wed, 28 Jan 2015 08:58:43 -0500
Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:61384)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1YGT8g-0000Wv-1S
 for bug-gnu-emacs@HIDDEN; Wed, 28 Jan 2015 08:58:38 -0500
Received: by mail-wg0-f50.google.com with SMTP id b13so20669226wgh.9
 for <bug-gnu-emacs@HIDDEN>; Wed, 28 Jan 2015 05:58:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:date:message-id:mime-version:content-type;
 bh=6bo15gOSUGrOYM7k9foBXnQHmqIw3SVK25sqVGdqLwk=;
 b=K22vy6tZXtWWZkaWB20eYnK7DFcHcJgTaipKe486FeCxvfp3Wv2A3k63euZyE1sdx3
 zV+cF8SLznO2Alyq7LQ5WNeszNpmZKpaRMPP2Nwtm1AX+rvSnDaF+QwciOtyMaUFRooQ
 1oyc1otvyUmyBFEhrITW12VzZJD7ZmBvnJSovzxFxmO9mUXnnaxENxlcACnKqpmyzd0Z
 LR4Ngl/D1V3pM4+vaauZZ62ef1lheeNpX36/m5vUcYilIHShWCr2G2Cr4S0YgyXryszV
 aXE4b0cUejCzqck7McYT4Z+St5h6adVc4WYyx7e2jStK2COx2dRR7r0CMwtAf6QptiO6
 bBLQ==
X-Received: by 10.180.211.2 with SMTP id my2mr7278195wic.3.1422453517170;
 Wed, 28 Jan 2015 05:58:37 -0800 (PST)
Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45])
 by mx.google.com with ESMTPSA id i4sm6228810wje.20.2015.01.28.05.58.36
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Wed, 28 Jan 2015 05:58:36 -0800 (PST)
From: Oleh Krehel <ohwoeowho@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50; (ad-is-adviced sym) is inconsistent with (advice--p
 (advice--symbol-function sym))
Date: Wed, 28 Jan 2015 14:55:01 +0100
Message-ID: <87y4on57t6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)


`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))





Acknowledgement sent to Oleh Krehel <ohwoeowho@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#19711; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.