GNU bug report logs - #66908
Exposing more public nadvice API

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; Severity: wishlist; Reported by: Philip Kaludercic <philipk@HIDDEN>; dated Fri, 3 Nov 2023 08:35:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 15:56:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 04 11:56:36 2023
Received: from localhost ([127.0.0.1]:35644 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qzJ0l-0006mf-Os
	for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 11:56:36 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qzJ0k-0006mR-CH
 for 66908 <at> debbugs.gnu.org; Sat, 04 Nov 2023 11:56:35 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6AAC3100068;
 Sat,  4 Nov 2023 11:55:52 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699113351;
 bh=e4idrSDCi/XQ9tSc/LgBB9JnZ7x8z3uAG4+FU8pM+24=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=pOOarZp8N0JqBexbrIhMlbe0kWos3JL+iu2qt3UdEhyzFb/fCWB/co/tONxFue8sY
 75zbVW8hkC8ILhRWwCCD+WPaXm1gULaZqfYdvkkxjRo+IomMlzSYJY4mCOEUGkYtln
 E6PBhaH78+LNhC1I0u1xLQ8qr2BiV9fCcuWkrSstSAuBdgPWdjP+BuDDKRnTOTxP4+
 NPB09PW76pQtpbUuez4vUkNsVdPOhSMFDtsezULxv+9MdhKafTikqUu4Ru1i5JOsUV
 uTjVjl9A8DUBBuYKexfHMe+tH88LPHkASOCMRSvl94XqQyfDQVEXIUqCB1S/Pr1SyW
 Kqg1pWU1TApGg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C460D100043;
 Sat,  4 Nov 2023 11:55:51 -0400 (EDT)
Received: from pastel (unknown [45.72.195.71])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9BC8A120213;
 Sat,  4 Nov 2023 11:55:51 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <87lebdyh48.fsf@HIDDEN> (Philip Kaludercic's message of "Sat, 
 04 Nov 2023 09:58:47 +0000")
Message-ID: <jwvfs1l8qe9.fsf-monnier+emacs@HIDDEN>
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
 <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN> <875y2ifd2c.fsf@HIDDEN>
 <jwvo7ga9hpi.fsf-monnier+emacs@HIDDEN> <87wmuydobs.fsf@HIDDEN>
 <jwvwmuy7xt9.fsf-monnier+emacs@HIDDEN> <87lebdyh48.fsf@HIDDEN>
Date: Sat, 04 Nov 2023 11:55:50 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.140 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66908
Cc: 66908 <at> debbugs.gnu.org, Visuwesh <visuweshm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.3 (---)

> The main issue here is that this checks if a function accepts up to two
> arguments, but we are interested in the minimal number of arguments.

Ah, yes you checked the lower bound, sorry.

> I guess that turning this around should work, right:
>
>      (condition-case nil
>          (funcall func)
>        (wrong-number-of-arguments
>         (condition-case nil
>             (funcall func (buffer-substring (car bound) (cdr bound)))
>           (wrong-number-of-arguments
>            (funcall func (car bound) (cdr bound))))))

Yup.


        Stefan





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

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


Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 09:59:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 04 05:59:33 2023
Received: from localhost ([127.0.0.1]:32913 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qzDRF-0001nX-JA
	for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 05:59:33 -0400
Received: from mout02.posteo.de ([185.67.36.66]:51675)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1qzDRD-0001nH-6Z
 for 66908 <at> debbugs.gnu.org; Sat, 04 Nov 2023 05:59:32 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 9BE05240103
 for <66908 <at> debbugs.gnu.org>; Sat,  4 Nov 2023 10:58:48 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1699091928; bh=dGaEAgRCfdXVgSJ4SYUdg/zYHcEZIefU+QnhOBAA18Q=;
 h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=Qbhmg7WNmUWU9KwP2BicCiK7WYCH2VtxJubzwia3QJXM8NKQpkK56Dx2N7EVZMLpz
 dGI0B7baOTs6uZZV5CSb3LNSL2HDZ8kRROj16ioz1F1SQFge16efKS5PLWBCo6QDth
 zSXwSsk7OzJZVHCCwVSUQy8leGRgeMfCz4tjCkPEUmJS2lL+d0qYRcGLGWKhfPzMSb
 Do8PXxEs34yVFfUGifhraSTrLc5eHTYL4UIc7tw3nNkc67p3gWn3PM3A/vFLPeXi9B
 400nrLE/50YBFFsvJduCq5mR+9V9JnPxI/0oFVRU6OjGCz6cA1d9FNrWpEir7XNH58
 FH+19uxyWZBHQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4SMtNl4x9vz6tsb;
 Sat,  4 Nov 2023 10:58:47 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <jwvwmuy7xt9.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sat, 04 Nov 2023 04:13:51 -0400")
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
 <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN> <875y2ifd2c.fsf@HIDDEN>
 <jwvo7ga9hpi.fsf-monnier+emacs@HIDDEN> <87wmuydobs.fsf@HIDDEN>
 <jwvwmuy7xt9.fsf-monnier+emacs@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; keydata=
 mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI
 BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
Date: Sat, 04 Nov 2023 09:58:47 +0000
Message-ID: <87lebdyh48.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66908
Cc: 66908 <at> debbugs.gnu.org, Visuwesh <visuweshm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> Sure, in Philip's package do-at-point, a function defined to "act" on
>> the `thing' at point are given different arguments depending on the
>> minimum number of arguments required by the function:
>
> Ah :-(
>
> So a kind of "unimplementable semantics" for DWIM purposes.
>
>>         (pcase (car (func-arity func))
>>                     ^^^^^^^^^^^^^^^^^
>>           (0 (funcall func))
>>           (1 (funcall func (buffer-substring (car bound) (cdr bound))))
>>           (2 (funcall func (car bound) (cdr bound)))
>>           (_ (error "Unsupported signature: %S" func)))))
>
> I recommend:
>
>     (condition-case nil
>         (funcall func (car bound) (cdr bound))
>       (wrong-number-of-arguments
>        (condition-case nil
>            (funcall func (buffer-substring (car bound) (cdr bound)))
>          (wrong-number-of-arguments
>           (funcall func)))))
>
> :-)
>
> Works with advice and other wrappers without having to worry about
> `indirect-function`, autoloading, etc...

The main issue here is that this checks if a function accepts up to two
arguments, but we are interested in the minimal number of arguments.
I guess that turning this around should work, right:

     (condition-case nil
         (funcall func)
       (wrong-number-of-arguments
        (condition-case nil
            (funcall func (buffer-substring (car bound) (cdr bound)))
          (wrong-number-of-arguments
           (funcall func (car bound) (cdr bound))))))

?

>>>>     (func-arity (advice--cd*r (indirect-function 'xref-find-definition=
s))) ;; =E2=87=92 (1 . 1)
>>>> which is the right return value.  It might be nice to not have to call
>>>> `indirect-function' here for the "global" function but you can be a
>>>> better judge of that.
>>> Don't know what you mean by "global" function.
>> By "global", I mean the new global function advice-cd*r or somesuch that
>> might eventually be added from this discussion.
>
> Ah, I see.  I don't think `advice-cd*r` should follow aliases in
> general.  But indeed, you may have an `advice` object whose
> `advice-cd*r` is a symbol, whose definition is another advice object,
> etc...
>
> Another good reason to prefer the `condition-case` approach :-)
>
>>> By "autoloaded" do you mean "setup to be loaded on demand but not yet
>>> loaded", or do you mean "had been setup to be loaded on demand and has
>>> been loaded already"?
>> The former obviously.
>
> In that case, `indirect-function` would not see the advice, then
> `func-arity` would cause the target to be (auto)loaded, during which
> a previously pending advice could be installed and it would return the
> dreaded (0 . many) from the advice it sees in the definition.
>
> Again, using `condition-case` side steps the issue.
>
>
>         Stefan




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

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


Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 08:14:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 04 04:14:37 2023
Received: from localhost ([127.0.0.1]:60414 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qzBnh-0007E7-I1
	for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 04:14:37 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59255)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qzBne-0007Ds-Qf
 for 66908 <at> debbugs.gnu.org; Sat, 04 Nov 2023 04:14:36 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0DD548076B;
 Sat,  4 Nov 2023 04:13:53 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699085632;
 bh=RBZeVhNHEe+4fGvpJ4h+sqzz+12x0YytrvsZFSSZuIw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=ezDXHWQZWj/p3U3eespxYhLz9+wsRNOYCUhYhYHIxqPyo9iPSH70NzFl7sdlHyFMX
 R92Baj6nwJ343MhVIsj1ZCXMZC5EM0f2AGMGpL9bfvI/boQEcQ2EPYjd8v6m4DInqn
 akNzHD6uLu1Gtb+ijbgz/oWGwGBbnth9Pqo6ZSiujO7LQPPRV3vQEJTauJvUaEUswf
 jp077/SvBfPDVjEZ5XTEm2DnsGPeA8ZUeffn3flUprZYBBOyydMWMbzw4RtK+85F4I
 YvB2JK/BtUmZcPPU6F/SMpqdYCSMK9iJA4KGWgNS1z0rXXHoPoT4gqin/UQ5Xj/hMu
 U/r9RZdmy39bg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2310A80409;
 Sat,  4 Nov 2023 04:13:52 -0400 (EDT)
Received: from pastel (unknown [45.72.195.71])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EAA651202FC;
 Sat,  4 Nov 2023 04:13:51 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <87wmuydobs.fsf@HIDDEN> (Visuwesh's message of "Sat, 04 Nov
 2023 11:58:39 +0530")
Message-ID: <jwvwmuy7xt9.fsf-monnier+emacs@HIDDEN>
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
 <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN> <875y2ifd2c.fsf@HIDDEN>
 <jwvo7ga9hpi.fsf-monnier+emacs@HIDDEN> <87wmuydobs.fsf@HIDDEN>
Date: Sat, 04 Nov 2023 04:13:51 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.007 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>, 66908 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.3 (---)

> Sure, in Philip's package do-at-point, a function defined to "act" on
> the `thing' at point are given different arguments depending on the
> minimum number of arguments required by the function:

Ah :-(

So a kind of "unimplementable semantics" for DWIM purposes.

>         (pcase (car (func-arity func))
>                     ^^^^^^^^^^^^^^^^^
>           (0 (funcall func))
>           (1 (funcall func (buffer-substring (car bound) (cdr bound))))
>           (2 (funcall func (car bound) (cdr bound)))
>           (_ (error "Unsupported signature: %S" func)))))

I recommend:

    (condition-case nil
        (funcall func (car bound) (cdr bound))
      (wrong-number-of-arguments
       (condition-case nil
           (funcall func (buffer-substring (car bound) (cdr bound)))
         (wrong-number-of-arguments
          (funcall func)))))

:-)

Works with advice and other wrappers without having to worry about
`indirect-function`, autoloading, etc...

>>>     (func-arity (advice--cd*r (indirect-function 'xref-find-definitions=
))) ;; =E2=87=92 (1 . 1)
>>> which is the right return value.  It might be nice to not have to call
>>> `indirect-function' here for the "global" function but you can be a
>>> better judge of that.
>> Don't know what you mean by "global" function.
> By "global", I mean the new global function advice-cd*r or somesuch that
> might eventually be added from this discussion.

Ah, I see.  I don't think `advice-cd*r` should follow aliases in
general.  But indeed, you may have an `advice` object whose
`advice-cd*r` is a symbol, whose definition is another advice object,
etc...

Another good reason to prefer the `condition-case` approach :-)

>> By "autoloaded" do you mean "setup to be loaded on demand but not yet
>> loaded", or do you mean "had been setup to be loaded on demand and has
>> been loaded already"?
> The former obviously.

In that case, `indirect-function` would not see the advice, then
`func-arity` would cause the target to be (auto)loaded, during which
a previously pending advice could be installed and it would return the
dreaded (0 . many) from the advice it sees in the definition.

Again, using `condition-case` side steps the issue.


        Stefan





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

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


Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 06:29:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 04 02:29:26 2023
Received: from localhost ([127.0.0.1]:60265 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qzA9t-0004Hh-V8
	for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 02:29:26 -0400
Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:51532)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1qzA9s-0004HT-FE
 for 66908 <at> debbugs.gnu.org; Sat, 04 Nov 2023 02:29:25 -0400
Received: by mail-pl1-x644.google.com with SMTP id
 d9443c01a7336-1cc0d0a0355so22397715ad.3
 for <66908 <at> debbugs.gnu.org>; Fri, 03 Nov 2023 23:28:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699079322; x=1699684122; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=RZpRzbUF26a4ncBhSTx2CUcKM+s6QvMT05MrXKxnlGc=;
 b=PnLEBNXZeIR1Df3oXKq263fC7w4KDasCBYubXEICU8XET47m40YgLB/NBipIDI03ox
 47PjTvuLbDCXJMQD6x+49gFrM3ZPYuHTyj3j2JypWuuu033OJ++qSLoLdHpxWiUyYO1h
 Z7Mdsxie6W+o6GiiskdrHQJVRnpPEE3RHnsmjWIhtuEAmvJELw5coMqdnjiYu0fuf7Xg
 F5RmeAmyP6/mDU7r5tE5ECSccd4ZsyEBMMhgnkHtQmIYIpiAtGaQfyMkfGOyWTHDLamT
 95vWL4p9D+Zk2inyDOIWf2vd9xZGcA+dBmJlYDV7Qc2z//MzTTMf3lsr4YSYdnlpmoaT
 nH4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699079322; x=1699684122;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=RZpRzbUF26a4ncBhSTx2CUcKM+s6QvMT05MrXKxnlGc=;
 b=bbtNKe6h/rVs6FZXc9jKqNaptYN4A9HK2GhmUDJ5tNFZzWS/TBHjNYNeIjp5BS5I2V
 q0K4Mpwr31mt2bgitTDwVjlCgVLh262Jde8UAVnErEM/m592g05IvgngcLJNI/u1STn1
 iTZZ00ByLvqwGnEwHFd5/Cr9Yssf/hD8JP7UmFAmzoWHtxGxaKeR73A/ok8Zw/2K8bGA
 g+/TazYIQU4/zwtOjVNH85v2CEvopa9Ls/mvg8BdxruosNDv1Gvt9bASy8IS6Yzp1Vbb
 6XgTbgw/SiWvKZ0b2sHwr9YHh8rNvfsGWrXpWhbuAbohzSFEH5n9ACmVZVtPZH+bvS3E
 JZPA==
X-Gm-Message-State: AOJu0Yzkj4/tzeH9zIybJt163rXyMHcso8+uQGfvVuP3Hl5jNmUPooSu
 RcIMnYPAlW/6Bkq1di41jUA=
X-Google-Smtp-Source: AGHT+IGqOIIFTBFVetx7qil0B4emy3ziXw9A6fqOq/7Cqe2irw/ss5qjNwsZR/WvwkPsr58ZavYPMw==
X-Received: by 2002:a17:902:f682:b0:1cc:7d96:3fe7 with SMTP id
 l2-20020a170902f68200b001cc7d963fe7mr10707746plg.28.1699079322405; 
 Fri, 03 Nov 2023 23:28:42 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 j15-20020a170902da8f00b001c5fe217fb9sm2269057plx.267.2023.11.03.23.28.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Nov 2023 23:28:41 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <jwvo7ga9hpi.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Sat, 04 Nov 2023 02:14:46 -0400")
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
 <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN> <875y2ifd2c.fsf@HIDDEN>
 <jwvo7ga9hpi.fsf-monnier+emacs@HIDDEN>
Date: Sat, 04 Nov 2023 11:58:39 +0530
Message-ID: <87wmuydobs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>, 66908 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -1.0 (-)

[=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=A8=E0=AE=B5=E0=AE=AE=E0=AF=8D=E0=AE=AA=
=E0=AE=B0=E0=AF=8D 04, 2023] Stefan Monnier via "Bug reports for GNU Emacs,=
 the Swiss army knife of text editors" wrote:

>>> Could you describe the circumstance where you need it?
>> We need to get the func-arity of the original function and not its
>> advice.
>
> That's the part I'd been (indirectly) told already.  What I meant was
> why do you need to find the arity of that(those) function(s)?

Sure, in Philip's package do-at-point, a function defined to "act" on
the `thing' at point are given different arguments depending on the
minimum number of arguments required by the function:

    (let* ((thing (overlay-get do-at-point--overlay 'do-at-point-thing))
           (options (do-at-point--actions thing))
           (choice ...)
           (func (cadr (alist-get (car choice) options)))
           (bound (cons (overlay-start do-at-point--overlay)
                        (overlay-end do-at-point--overlay))))
      (when func
        (pcase (car (func-arity func))
                    ^^^^^^^^^^^^^^^^^
          (0 (funcall func))
          (1 (funcall func (buffer-substring (car bound) (cdr bound))))
          (2 (funcall func (car bound) (cdr bound)))
          (_ (error "Unsupported signature: %S" func)))))

Currently the func-arity call fails when the function is adviced.  This
is a nice format to follow since it

    1. allows reuse of existing functions to be executed as actions
       without the need for wrapper functions=20
       [ i.e., (lambda (str) (xref-find-definitions str))  ]
    2. allows the "action" function to specify what it ends by changing
       its required arguments.

I hope this is clear.

>>     (func-arity (advice--cd*r (indirect-function 'xref-find-definitions)=
)) ;; =E2=87=92 (1 . 1)
>>
>> which is the right return value.  It might be nice to not have to call
>> `indirect-function' here for the "global" function but you can be a
>> better judge of that.
>
> Don't know what you mean by "global" function.

By "global", I mean the new global function advice-cd*r or somesuch that
might eventually be added from this discussion.

> Side note: an advice may also be installed specifically to change the
> arity, e.g. to add support for some new calling convention.

Ahhhhhh... now we have a complication that I never thought about.

>> In our case, the functions that will be checked for its arity should be
>> defined at the time of func-arity call.  Or at least auto-loaded AFAIU.
>
> By "autoloaded" do you mean "setup to be loaded on demand but not yet
> loaded", or do you mean "had been setup to be loaded on demand and has
> been loaded already"?

The former obviously.

> The second case is "irrelevant" in the sense that it doesn't matter if
> the function had been autoloaded before it was defined.
>
>
>         Stefan




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

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


Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 06:15:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 04 02:15:32 2023
Received: from localhost ([127.0.0.1]:60255 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qz9wS-0003vx-8g
	for submit <at> debbugs.gnu.org; Sat, 04 Nov 2023 02:15:32 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qz9wQ-0003vl-Io
 for 66908 <at> debbugs.gnu.org; Sat, 04 Nov 2023 02:15:31 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0D3868076B;
 Sat,  4 Nov 2023 02:14:49 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699078487;
 bh=uTwFEq9g58XKu1lGjXUBuKMiUprR9edcoyT2BOTM6Js=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=fSZ7w0muAUy3T3tn5LA73t30PIZHhAcwNfr3+a5l/CPYiqSrRewIbOijvixnXCOi7
 MYXISvJAOzYkpMKTAOT/iTQMJ+eHauzvGvayJ/cH48IQHEcRXDuPlmIV8jd/TJFtnU
 5sRSf/otLNrAuJnL2I3uovGh/WiCSQpriGa3HQPLrH6Oth8lR3CW3Ah3iLNtRfcFxU
 sDMOkJHrj8FQec2mV7AiBUceNZQTWBiK2VQx5jF8AXUDd+NGn+xe5zFE06TIPVI712
 rJIcoFWYzYnDbPwHIFgmrhK1wMWlG3SRiyJwKsJFsi7OmXkjtvBAWzCQHpYMg+uge1
 g3P8bb9l6wKTg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A8460805BA;
 Sat,  4 Nov 2023 02:14:47 -0400 (EDT)
Received: from pastel (unknown [45.72.195.71])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7B919120203;
 Sat,  4 Nov 2023 02:14:47 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <875y2ifd2c.fsf@HIDDEN> (Visuwesh's message of "Sat, 04 Nov
 2023 08:18:59 +0530")
Message-ID: <jwvo7ga9hpi.fsf-monnier+emacs@HIDDEN>
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
 <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN> <875y2ifd2c.fsf@HIDDEN>
Date: Sat, 04 Nov 2023 02:14:46 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.007 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>, 66908 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.3 (---)

>> Could you describe the circumstance where you need it?
> We need to get the func-arity of the original function and not its
> advice.

That's the part I'd been (indirectly) told already.  What I meant was
why do you need to find the arity of that(those) function(s)?

>     (func-arity (advice--cd*r (indirect-function 'xref-find-definitions))=
) ;; =E2=87=92 (1 . 1)
>
> which is the right return value.  It might be nice to not have to call
> `indirect-function' here for the "global" function but you can be a
> better judge of that.

Don't know what you mean by "global" function.

Side note: an advice may also be installed specifically to change the
arity, e.g. to add support for some new calling convention.

> In our case, the functions that will be checked for its arity should be
> defined at the time of func-arity call.  Or at least auto-loaded AFAIU.

By "autoloaded" do you mean "setup to be loaded on demand but not yet
loaded", or do you mean "had been setup to be loaded on demand and has
been loaded already"?

The second case is "irrelevant" in the sense that it doesn't matter if
the function had been autoloaded before it was defined.


        Stefan





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

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


Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 02:49:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 22:49:46 2023
Received: from localhost ([127.0.0.1]:60166 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qz6jK-0006mv-Fa
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 22:49:46 -0400
Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:55691)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1qz6jJ-0006mL-04
 for 66908 <at> debbugs.gnu.org; Fri, 03 Nov 2023 22:49:45 -0400
Received: by mail-pf1-x444.google.com with SMTP id
 d2e1a72fcca58-6bd32d1a040so2894154b3a.3
 for <66908 <at> debbugs.gnu.org>; Fri, 03 Nov 2023 19:49:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699066143; x=1699670943; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=joXp6oIe0lnx1FFYt9M6IoMF2fKMufK6G9yzdRHTUbw=;
 b=Sq7pR+luSy5twz/ez7+tmS4ANeTNUDBWULa9w9osLpfnzggUjMn8ZiquSnwH//tBE4
 c7Ixbrq9Kop8dicuA2+Wwg1D0sFD4g2yq4vgApDgMogU5RUP2Usd3CsGmv2cIaTRmfuu
 HHzQEQDKhQylKhH/Eto4l9idgR19236ECIVPQ9VMFv+tnbPOyIgXQffPzerzvZgDMyD/
 ljtEQruROukYTZQ3BgCZrzjBdk3iuV7wjuRHAUjSQfGYOEYRunLpcV+UgnEW0AiBdmcr
 QanlaAhalooeTUYXNgss8RjvfMpBhQRhJOF9a0WXWJKstKh54Tc3fuYMqP6MuCxFUs2V
 cqwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699066143; x=1699670943;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=joXp6oIe0lnx1FFYt9M6IoMF2fKMufK6G9yzdRHTUbw=;
 b=I9M3WCFhEngUC02iuV1AkpxnBce0MSz7uY9vRGK10FBjch+KLXsuqX8ZLU1xdLWCe4
 qSlVrjuBaPMdSN5h9gHP4eyZPFSj+xHj38AA31O2o9IYFEe1UYl3+ZnQAwCOq4yv4gbN
 gvR3x8p/qtBEZ/rTJTxkTSvs91CHsllmR98rB+f8npoTkyf8SC8pyH7Mt/Is0lBj4NWJ
 ikDbYRoEkpsk1fKxX961tzJmG7NdtO2N0yuhXS44n/nbrLbCCtSC35RSz0abIDeXV8v3
 1UyRgyOXT3bT6ZQHprbJbFC5RigmWIRm612fnpzDzd1ttPZPBOsrE+HxdN8M6EZzSptV
 iuVw==
X-Gm-Message-State: AOJu0Ywml980sE/t31W6B58cvVwCBLV0QKsrrkO9xGpBaNURBuC+MkWx
 MhI7iNFV5PL0aXiJ8Exh1G0=
X-Google-Smtp-Source: AGHT+IFkpBDmGVIvFbMuGMLs1/ywD8Ilha0n4VIELzsIhEXVHmcrz2iX+b1US9k+FFCg2CZVD899CQ==
X-Received: by 2002:a05:6a20:8f1c:b0:153:63b9:8bf9 with SMTP id
 b28-20020a056a208f1c00b0015363b98bf9mr28472477pzk.0.1699066142855; 
 Fri, 03 Nov 2023 19:49:02 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 j16-20020a056a00175000b006933b69f7afsm2041994pfc.42.2023.11.03.19.49.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Nov 2023 19:49:02 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 03 Nov 2023 18:05:40 -0400")
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
 <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN>
Date: Sat, 04 Nov 2023 08:18:59 +0530
Message-ID: <875y2ifd2c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>, 66908 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -1.0 (-)

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=A8=E0=AE=B5=
=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2023] Stefan Monnier wrot=
e:

>>> It's clearly the internal function most frequently used outside of
>>> `nadvice.el`, indeed.
>>> I think it'd be OK to promote that function to a non-internal name.
>> It would be nice if you could since it would also provide some guarantee
>> of it being a fairly stable interface.
>
> Could you describe the circumstance where you need it?

We need to get the func-arity of the original function and not its
advice.  I have xref-find-definitions adviced but

    (func-arity 'xref-find-definitions);; =E2=87=92 (0 . many)

returns the func-arity of the advice meanwhile, what we are really
interested in is the func-arity of xref-find-definitions as shown in the
*Help* buffer i.e.,

    (func-arity (advice--cd*r (indirect-function 'xref-find-definitions))) =
;; =E2=87=92 (1 . 1)

which is the right return value.  It might be nice to not have to call
`indirect-function' here for the "global" function but you can be a
better judge of that.

>> The other function that I saw get usage outside of nadvice and bytecomp
>> was advice--symbol-function.  Should we use its return value, or is
>> indirect-function's return value good enough for advice--cd*r?  IIRC,
>> help-function-arglist uses indirect-function and it also works for our
>> use case.
>
> I don't think `advice--symbol-function` is a good candidate because its
> semantics is not very clearly defined.  E.g. I'd be hard pressed to give
> a comprehensible documentation of it without either being too vague,
> or promising things I can't always provide, or getting too much into the
> the nitty gritty details of the various possible situations.
> That's why I haven't promoted the comment in its body
> to an actual docstring :-(
>
> Most callers are in only one of the many different situations, in which
> case they usually don't need that functionality.

In our case, the functions that will be checked for its arity should be
defined at the time of func-arity call.  Or at least auto-loaded AFAIU.
Philip can correct me if I'm wrong.




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

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


Received: (at 66908) by debbugs.gnu.org; 3 Nov 2023 22:06:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 18:06:26 2023
Received: from localhost ([127.0.0.1]:59929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qz2J8-0002Zu-7L
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 18:06:26 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59809)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qz2J6-0002Zg-CY
 for 66908 <at> debbugs.gnu.org; Fri, 03 Nov 2023 18:06:25 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CF188100061;
 Fri,  3 Nov 2023 18:05:42 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699049142;
 bh=aCKD7PbhgKA+QCfKszDXkeZ3cdFbpuyXHaJpfhyTvrI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=fAFILmhiPHGSdjHzqlVrpdQPIEUJLCUmjwT2kHgD47t7Fm4iGCD/Gd/UD+YaqOqs4
 yPjvG1ExmO9v91q7hoA4x9y2Vhu6Z8xOBdt0bwI17UqOGeNG97Wsx+hbkc/ZjTxjlT
 JNVuU4qVNylM/rpSUKWSaKA6OfqNKSUUmn+ZRz7hGA4CqNuw+wTwWVt2TZXHbotLZ5
 Il06ffhBHoYDV1rIgnwvsYLZBYEaovtwzw5aZ9BDzBHXdbXYyNDhky5NWpuRfjUZQ2
 XwDOFagfcB+8b+Zt7A1mZCu8M23dB2BvWs1/7/q7mXYF5vqo4UBJhJwPaA08+4mKpS
 bIekljOgWQjTQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 25239100033;
 Fri,  3 Nov 2023 18:05:42 -0400 (EDT)
Received: from pastel (unknown [45.72.195.71])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EC6F61201B6;
 Fri,  3 Nov 2023 18:05:41 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <87msvufz8n.fsf@HIDDEN> (Visuwesh's message of "Sat, 04 Nov
 2023 00:20:00 +0530")
Message-ID: <jwvfs1mbivc.fsf-monnier+emacs@HIDDEN>
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
Date: Fri, 03 Nov 2023 18:05:40 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.142 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>, 66908 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.3 (---)

>> It's clearly the internal function most frequently used outside of
>> `nadvice.el`, indeed.
>> I think it'd be OK to promote that function to a non-internal name.
> It would be nice if you could since it would also provide some guarantee
> of it being a fairly stable interface.

Could you describe the circumstance where you need it?

> The other function that I saw get usage outside of nadvice and bytecomp
> was advice--symbol-function.  Should we use its return value, or is
> indirect-function's return value good enough for advice--cd*r?  IIRC,
> help-function-arglist uses indirect-function and it also works for our
> use case.

I don't think `advice--symbol-function` is a good candidate because its
semantics is not very clearly defined.  E.g. I'd be hard pressed to give
a comprehensible documentation of it without either being too vague,
or promising things I can't always provide, or getting too much into the
the nitty gritty details of the various possible situations.
That's why I haven't promoted the comment in its body
to an actual docstring :-(

Most callers are in only one of the many different situations, in which
case they usually don't need that functionality.


        Stefan





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

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


Received: (at 66908) by debbugs.gnu.org; 3 Nov 2023 19:25:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 15:25:26 2023
Received: from localhost ([127.0.0.1]:59832 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qyznK-0006i7-BW
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 15:25:26 -0400
Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:2086)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1qyzn9-0006hV-7A
 for 66908 <at> debbugs.gnu.org; Fri, 03 Nov 2023 15:25:24 -0400
Received: from pps.filterd (m0246631.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 3A3G7GNv001813; Fri, 3 Nov 2023 19:24:38 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=from : to : cc :
 subject : date : message-id : references : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=corp-2023-03-30;
 bh=uie3tS8QxgPx6RxZ9H2BGqTRqt6iFMJ4fPVdVtT6tX0=;
 b=pM4Lstx3ReiRuuCVBCNLn884Dzbmf/EmT51CKebVhz3jUAL7jGoe2NbBmguQYoe63+dM
 32UTonLvmSWvGnCXJfwF7WByTo6jirkeWUoL/qr4LugTYQzEpRDpi5aiTec5VJySLvms
 9BDit8Nt7G1m6Xp0yRzoTsGd5ox/nOSCGPl3EEBnEk93Fzpod5RNVbz/iN7VQqkh6ywQ
 5VSvLKv9PsO5BtLeEcqRmJJTK3nyMMr0HBapw5GLsxQeeGDX5tx43PYPWoCINksWoIw7
 omNZ6YJyjs/33GNCJfhAUSbVsaUx1G3jhfNgozOiWzbSj3A4qfN6BCCzpOktdQ6vC7IH qA== 
Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com
 (phxpaimrmta02.appoci.oracle.com [147.154.114.232])
 by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0s344thj-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 03 Nov 2023 19:24:38 +0000
Received: from pps.filterd
 (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1])
 by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19)
 with ESMTP id 3A3ILGcS020086; Fri, 3 Nov 2023 19:24:37 GMT
Received: from nam11-bn8-obe.outbound.protection.outlook.com
 (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169])
 by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id
 3u0rrajqfv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 03 Nov 2023 19:24:37 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Vsbr6ykx7UWbwzZ/Y8sRauROAKzXaNreAUTFSQtlnmGLbEeawy+TtXml9iiGpUIiw7PLqgKKnOY1uTpa6TVhOR2lJugnWRQJV+5Nq3FwQNN0H4ua1VaQ++c9fL3uG/EdVoo7DPD1Zsk0k1j9sMeIJPi3QzW+z83mtECv2DPglPIrNclEaFjElwFpybel1P+T2rZuQE7hzLXZ7O3EbTxwA0mCL36C5CwQmrjhAg172Z7DIUZ5G1yDRAzx8Ec8yK+tAQ9A5zrqiLvjRR2SHDDzIL5bn5TwpA1RIr2n9p68ZEv+HS5i7pVm5apiX82DgAVH6J7plMtkeS6Bn1zU2wCBWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uie3tS8QxgPx6RxZ9H2BGqTRqt6iFMJ4fPVdVtT6tX0=;
 b=HZiTcIm6/F9ujvXgHaQ/Tn0EM2ijCbPdOyRk6Ra73bSye6iUt+Owgoq3EosFc0/gkkaCETh0FNaRK/Xv/HL9LFm42W5O4jR4X0Bzgsg2Lvg/iey9VFJ2yFY5a7CEqLTdXsDzRgYNj6UWCekBjPYhcGrBEt9mYOEHymLcH06/iL7a9ZlY1YSS0cyhWS5kUidPtoNyKKNkKl2CFrvMmDC29Mat3J9N98ZtOzj3cz5zHBaIzbfME70hZV7fEC70LdYWYiKU9CpW5bVPQDpk3Qyz3Oni3C3xjuohm26YEun2RrNfMektuKFB3VdZlr5OtXJvwls67rOG5E0PVc38bvmUIw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uie3tS8QxgPx6RxZ9H2BGqTRqt6iFMJ4fPVdVtT6tX0=;
 b=ZTQqOwPSR6EzG6T/SbL5T7aF/Zj2YvrxFb3cqiFbjMYQgbW3LSZ13bFpFasxvAP3l9Ep+AB6FTXmRDqSrZTPOBI3hDG/pQaCstp8xfI8FSPHsDSl6jyLXH9HCyB9fFE4cnDSoJwl3qYXTcjCIIYO4LKVLiYZAHnxautyv1LRdsM=
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19)
 by CH3PR10MB7435.namprd10.prod.outlook.com (2603:10b6:610:15c::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Fri, 3 Nov
 2023 19:24:34 +0000
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::9e11:9d8c:b7f4:f45b]) by SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::9e11:9d8c:b7f4:f45b%7]) with mapi id 15.20.6954.024; Fri, 3 Nov 2023
 19:24:34 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Subject: RE: [External] : bug#66908: Exposing more public nadvice API
Thread-Topic: [External] : bug#66908: Exposing more public nadvice API
Thread-Index: AQHaDoamvV9qqxst60C0bV6yghXp9bBo9wmQ
Date: Fri, 3 Nov 2023 19:24:34 +0000
Message-ID: <SJ0PR10MB54883698EF4E5EA7C8462A49F3A5A@HIDDEN>
References: <878r7fw802.fsf@HIDDEN>
 <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> <87msvufz8n.fsf@HIDDEN>
In-Reply-To: <87msvufz8n.fsf@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CH3PR10MB7435:EE_
x-ms-office365-filtering-correlation-id: c4ac2767-91b5-4090-ffc1-08dbdca28312
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: hOpeHK8rfzZnvZ8mPJR4fsd+rfXXl1N4RMNbrv0RqQGkGoOCYVk/ctQUgcbPS5bxLFTpLNl9DljsV1r9YIYDISYzXms+eV6yDPOmYSIpRyzVwaDNpN7mjnqfvyMgpfMfxxDTGLy69cb4kAK2dwyTXrdxNF34MezQwPKor96wHD7PmP2s33+MP8BiPjbLJXmnVvs4bGy8+WRpiABoB74BU5UOeKwkKPAUx0F1ipSfKgHLTvkI1pl5DrWLKghVo7C4caj8TVPwqeYFy1AjKeJGEED1/wzv6CsbmB4SVRZew9mOHVIe82eN6DDq2fjxtKUueoBZV+hpJrDiyZnYPqhMOA3tFbguiOq1IOWViPInaASGuJBjV5YzN7vFMDZk44lVsQ10jfrMv1KKdkGRXkXKR0HdhJ1bL5d+HDpbxIFMK+Qfi4ZpK2VIXeq0Dj7x6PV3kkt/mddoEgg1GmuirdahVgyW9SEmrVXCnE0nAaxueexxmU10xHzSZVGgGEMZK+VlOBpQvpb4q3lc1rQya3E7YGqbmXH+n8Dt4xe8XeXAxcl4SfcHAjBpExMIfMsQdsHU4kLHABPbkV35MLdJTwLVT2EzGPAyJUbywF6C11WmU7IYUpAxbL+UdXA9rvfmQaSP
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230031)(396003)(376002)(366004)(346002)(39860400002)(136003)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(26005)(6506007)(55016003)(9686003)(71200400001)(8936002)(44832011)(2906002)(7696005)(316002)(478600001)(64756008)(76116006)(66946007)(41300700001)(110136005)(52536014)(8676002)(66476007)(66446008)(66556008)(54906003)(4326008)(5660300002)(122000001)(38100700002)(558084003)(86362001)(33656002)(38070700009);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?allmbUVNZWo4UklBQkpwSmFlZS96bll4dXc5V081N0Mzc1FVZ3NBZ09KcWxo?=
 =?utf-8?B?cHNJdW0vbjJWd2ZkbnI4cVZWVXJaTXpSNkswTktFUTJyTXpKNFJkNTJ4RVNM?=
 =?utf-8?B?RGtrTldzUHlQWVF0U2o4Wk5Kcyt0SitkeTNIakhuK1h2Sk1ORGhsaWRHKytO?=
 =?utf-8?B?S01YZDVWWDlyeStiVFhRR1ZQQUFMNFBrZThjSWRSbncwN0RjWmdGanhLdURF?=
 =?utf-8?B?NFk2SDY1bDhmSEpzVzhpTVBuYkJsMlVwSmRVMFFpZWtvQS9VbUNmc2FoUFhL?=
 =?utf-8?B?SWR2bUsxVlpNZWxZa1B5amxGK1RoaVNBVko2NkR4NDEyMXJmNEIvazg2MG04?=
 =?utf-8?B?OE5VZ2pTMnhpWXU3VEp5YVM4THp3WGEzSG01Ymx3OW9yUDVVZDAyeG9kZ0dm?=
 =?utf-8?B?T2VNMncwWW45RWxINHRuY0JyZDlwOXNLQmNPNnhrRFgzd2tpdnBvRFhPdm44?=
 =?utf-8?B?WlQ2cjhjZGZKYjR1VDVLZG1Yd3FDbnVkekI5M2F6VFBUVGhNK0R3VURnVnA2?=
 =?utf-8?B?KzV0N3d0NllJbmppS2thQUgwcmJqOUZYUWlUVjIrTGRxU1N3UWUxVVI4UFJV?=
 =?utf-8?B?YVI5Y0JqaUo5eFBGKzhYb2I5eGNMbFlFd1czclFDK0EyL3ZSbkJ6cEJFZ0E4?=
 =?utf-8?B?TDIxeCt5MVVvVFpIV0RiYXlja3Rhb3hVdFRiZjViWHZYRkV4NjEyTHZzNmF6?=
 =?utf-8?B?V3EwV1UyUklleDBDM0VzQmZiTEFUS1V2ODRhaWN2ODBkejFtd3ozY1dRLzBZ?=
 =?utf-8?B?WEdINEhzZHJnelVSbU82U3c3U0xTNkxoOWthdkJ0TlRQUVBRS1ZFNU5sZThm?=
 =?utf-8?B?Q1hWMzZUUW1TM1NISTZnb0ppcEZLYStjckQ0aWxuOTd4eGloalFIdnJqYUgv?=
 =?utf-8?B?RUpZMGIrL0pOMlFKM2FLVWhJcElYRE5JWlhZeHhaVVdUMXBFN3NPRHlhdkpp?=
 =?utf-8?B?cFB2dDFOUjZOeW5qcUk0MmloT0lGbDVsakQ5Tlk3cE1IOCtKbVlCZWN1b2hX?=
 =?utf-8?B?a05lUlA4Wlg3ZGpEUzVoMDBmR3k5NUlnYlNsRHk1Y3pNLzRIekhTRFIycmRq?=
 =?utf-8?B?Qy9rcXE2YlRGcFROMlpzTzd2Z2paRE9HMW41QW1rTXdPa1gra0ZKTDFTTGc2?=
 =?utf-8?B?S0ZYUThsUy9WWnNqU2tGbytnbG1sREFQbjhLaG5qWXVUNEVjNHpiTEozNUwv?=
 =?utf-8?B?SDQ2N29GL1lySUZpTjBKVkN3TTRjQ0xBQ2Zlci8vZW92MEY1cHFiUlAyRFRM?=
 =?utf-8?B?c20rbmxxcWVvT0tuM3U1TkszTkV6K0k4WTlodEU0YWgybU4xSFpPNEJRMlYv?=
 =?utf-8?B?MUV1Vk8zR3NaSkhEckJZdm5ISjd6L3FGRWczT0pBYzIzNjdvMVF0YVY1cDd4?=
 =?utf-8?B?a2h6TFZYejc0RlVRWGZtaFY3QjlLZ1J4ODVURDdWaUJwb1dheFExYmVmM3o1?=
 =?utf-8?B?a1k5bXlUZlJmMS9xSzMwY3JlVU5oVXliNDNpbUxNaDZ3MGtxbGhVRHErZWIz?=
 =?utf-8?B?NStsclZQaU5FVlp4RjY0YVV6cm5pZ3ZtcTdWaGNuYVlCOEc4TUtNakx5Qm9S?=
 =?utf-8?B?bkhoNDZ2R3ZnWFNMVWl0TkxqUWEyRFg3WFVJcFV3bmZuM1VGejNMRCtBRGdQ?=
 =?utf-8?B?ZmFmdllCbHA3RjdlZW4zbGtTS0pJQWhlZG5CWFYvd0tEeFBWNE9pUGpkOXUy?=
 =?utf-8?B?dlNOVXpUQW80bW9jamx6V21CR2YwaERmbURBdFN5SGNLeG5QNElDclBoUWVO?=
 =?utf-8?B?cHZ2bUFtRU1DRmlTMnV1NUV3SHR3ck4zQk5QcmVsSGlsVGxSNkpJcVpzbTNs?=
 =?utf-8?B?a24yM1lmczNNa2JmVE9FSjZ0ZTVIYURrcTNIWXQxcFRGcGVPdC9takM5TFB6?=
 =?utf-8?B?TTh5dzlFcGJKajBjOW0xcjlzczRYOHF5cGtrUXBpU3MxSU00eHJ0TXErK1Zh?=
 =?utf-8?B?VEpaMnB5eE1pVktZUTBKU3B4bUNMSmlWdlM1OFNaNTVwTGtYVWxmRFNlT2Ir?=
 =?utf-8?B?MVFhdjlBUy9EK3dwdVFyTk8zNUEvelhkZkVxZjlpOThRRVNxNTBzYiswNUll?=
 =?utf-8?B?VUxEVXlNY01ydGJmR2pJYitFZ2VpZHJoMEQ2UGYxTUdMTGNLdmJ2OWtjejA2?=
 =?utf-8?Q?cyc9GuadGtAbQLxQ68EtzrSNi?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ojXNVD9HGZio/d8Qs/bvhbyPOMODvbcfbBlHdfk9E7QHBRa9S4hxLOMn+vZnLaxPs5z9bAz6ajvRuBH+rV58zL0Mt9/AgL/ySyX8AelG5ld0qilmD5gtCbv0O3lKup8qUDlpS5xp3M2BEAKf6FoE5SAgmIIl4eUU6sWVOEkh3Imi1CUptJkDP1VEe6Wm2SycsYqTblHAdQezej+Ur6xXeHWq2IFAu9fyRi6urBufjjV5RufNoT2RIpuc6ziEOjvHRLF1pjiP22xp+LQpwK9rR0cFsVNieqoaPLO+7TkTTUJOgqij6ud90zV1hKalEhM9A8ayxFmYE2bFyQMW2T8bnDEVsd67nN8+l9L3m0Fo1LTbjw8VHD6V/+XagWDin7QwveEQChCCHLFh5PQIK5xBqLjWbr/aJZ+ebIUNARqGLmK4weUq8mqv9zRdwAqbAE94fCmjF4SynNO2ElOkJ/wBwG4I5q2ojtj12zW63FlDpVu8UhBtn60uzz3wqAGa/4nq/tFOMvjuWUJZkgOCTIjpCOv6QuWlEIv1A+QuJeY4UgtnOchDbClznUY33khbHOQThcZRAr6Aens4LGPXkAd/ncOcyt7IMqld5OPMHNC2zb9PlZV94FdRUOs6bhF+3/6pdMnlMXwCJxglsrGF6vIW+y6b/CrIDuHsNzr9IygfxsKC6gFXGbxWAE5qd2RUXTl8w0t0e+nJD+Rv38BbYJrIV8dhJxCdZHoMug7T9otmE5MCjRcQ+IW3F0u9tFxrDSf8aG5DEG+B6N9hOkXEEnvltopBXp9/CzWNsyDrt9oaBcGrnFxrUTFVC/Q56eXkVY5WqU9nY23DCBlAN9veyb0vqArzQttWzwg2QO96imDF7gE=
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c4ac2767-91b5-4090-ffc1-08dbdca28312
X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2023 19:24:34.4673 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: mOi2v4Jp11ZnhftbNLv/ZD6UlOWHmXelrjTq/0GmvfYn8b0NBkLKR4LYlMl4BTPtdffHtq+UYCNXWwbPTA8hkA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7435
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26
 definitions=2023-11-03_18,2023-11-02_03,2023-05-22_02
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 suspectscore=0 mlxscore=0
 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=513 malwarescore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000
 definitions=main-2311030163
X-Proofpoint-GUID: fvMnnAnCbGS7b8_XfnIxFHiGofizNyyq
X-Proofpoint-ORIG-GUID: fvMnnAnCbGS7b8_XfnIxFHiGofizNyyq
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>,
 "66908 <at> debbugs.gnu.org" <66908 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -1.7 (-)

PiBUaGUgb3RoZXIgZnVuY3Rpb24gdGhhdCBJIHNhdyBnZXQgdXNhZ2Ugb3V0c2lkZSBvZg0KPiBu
YWR2aWNlIGFuZCBieXRlY29tcCB3YXMgYWR2aWNlLS1zeW1ib2wtZnVuY3Rpb24uDQoNCmFkdmlj
ZS0tY2FyDQphZHZpY2UtLWNkcg0KYWR2aWNlLS1jZCpyDQphZHZpY2UtLXANCmFkdmljZS0tc3lt
Ym9sLWZ1bmN0aW9uDQo=




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

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


Received: (at 66908) by debbugs.gnu.org; 3 Nov 2023 18:50:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 14:50:49 2023
Received: from localhost ([127.0.0.1]:59745 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qyzFo-0005j0-Mw
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 14:50:48 -0400
Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:54470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1qyzFm-0005ij-0M
 for 66908 <at> debbugs.gnu.org; Fri, 03 Nov 2023 14:50:46 -0400
Received: by mail-pf1-x442.google.com with SMTP id
 d2e1a72fcca58-6b89ab5ddb7so2624382b3a.0
 for <66908 <at> debbugs.gnu.org>; Fri, 03 Nov 2023 11:50:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1699037404; x=1699642204; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=XrTnyGdHRmjQHHfTc4e4eWeAMiNCKnw9a65tEDoSsqM=;
 b=OxfwZEtrjuxNaONwb3A/mBI+G85mpzLQwqoohAfdnTyPPxHb9ahYwXYUZrUxw09LVm
 T+ngjhNZyur2WiIZ//4TnEU/lWY9re64yCRf+EupB7K4v7+0kBGkDC8oiherqt6koOgX
 OmmIx24K1M1h9s9LdbIBM7HQorYOMRl/SDStpjciCKJDA/DfGW9AWaHYvhdeB4Urk6v+
 MwMwAF6rrWcAdnBf5xJpOsQLBCaFuS09lHIlJEzsIPnSVlxhNhlsKw4jHn1iWV9GF0Om
 mGxiv/Exrx/LE4EgWF7CFZvgUHNeGfvMEufsn87eS8D3PrK2/McJL6+ld5vbmZTozJuV
 Vcfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1699037404; x=1699642204;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=XrTnyGdHRmjQHHfTc4e4eWeAMiNCKnw9a65tEDoSsqM=;
 b=DzawIYqnL7loXn+VYQpNgAnVfxroybtZDWeAo6RTIX9IdG9mPqtc9rIeBnujTlDZIV
 OA1VAV71eDcOK+N/2lOgRBjzmcrlqbWBIWW/QxzvisWQSNsGhFTjza0f8V2zB23+x5tw
 2Vw/84sakXEugsVvEoigsezUpCaRKUY/xUtM5O6RJFBOHJf4w71AMqUQyQuAVtMVLTIV
 Y+grVXuB2U+BFOJ5C/Zd+RprUHaWmnXddNgLembmos3suWWzdx/PT1/WVxTiLxleN0cv
 j09c+fYPquyUSKy/bsJ6zfqzi5ACzX2lpNs5lF0QGgQRWrRlyB7dqL++QC4RehOpnMqw
 Tgpg==
X-Gm-Message-State: AOJu0YzUxYh22yErTY1KkuiSnz/fPTQjQtWT2Xw+BjHNaMjv+3VGheaI
 6EJHp64Mg6ey5FOQQ+y2Vow=
X-Google-Smtp-Source: AGHT+IGHmVs9oMMpePMw0OCM13PzGF0/v0znvNVhm426w0LsvcR/M2ebcsgr/KS4QuNJGdA8uovs+g==
X-Received: by 2002:a05:6a20:da86:b0:140:f6c4:aa71 with SMTP id
 iy6-20020a056a20da8600b00140f6c4aa71mr31189074pzb.8.1699037404404; 
 Fri, 03 Nov 2023 11:50:04 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 x16-20020aa793b0000000b006c344c9f8bfsm1736523pff.87.2023.11.03.11.50.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Nov 2023 11:50:04 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 03 Nov 2023 12:22:42 -0400")
References: <878r7fw802.fsf@HIDDEN> <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN>
Date: Sat, 04 Nov 2023 00:20:00 +0530
Message-ID: <87msvufz8n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66908
Cc: Philip Kaludercic <philipk@HIDDEN>, 66908 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -1.0 (-)

[=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=A8=E0=AE=B5=
=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2023] Stefan Monnier wrot=
e:

>> Specifically `advice-cd*r' would be useful,
>
> It's clearly the internal function most frequently used outside of
> `nadvice.el`, indeed.
> I think it'd be OK to promote that function to a non-internal name.

It would be nice if you could since it would also provide some guarantee
of it being a fairly stable interface.

The other function that I saw get usage outside of nadvice and bytecomp
was advice--symbol-function.  Should we use its return value, or is
indirect-function's return value good enough for advice--cd*r?  IIRC,
help-function-arglist uses indirect-function and it also works for our
use case.

>> though it might be that we (Visuwesh and I) are trying to do the wrong
>> thing, since we want the return value to get a more sensible response
>> from `func-arity' -- and I recall we had conversations about the
>> complexity of this issue in the past before.
>
> There are very few places where `func-arity` can be used reliably,
> indeed and most of those cases are better served by
> `help-function-arglist`.
>
> In the case where `func-arity` is used for backward compatibility
> purposes (where reliability is not really possible anyway), I've
> generally recommend the use of
>
>     (condition-case nil
>         ...
>       (wrong-number-of-aruments
>         ...))
>
> instead.  It comes with its own failure modes, of course, but it's
> usually easier to use and I found it to fail less often in practice
> (because it's not affected by wrappers like those introduced by advice
> or `apply-partially`).
>
>
>         Stefan




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

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


Received: (at 66908) by debbugs.gnu.org; 3 Nov 2023 16:23:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 12:23:29 2023
Received: from localhost ([127.0.0.1]:59595 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qywxF-0007dh-EF
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 12:23:29 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qywxC-0007dS-LO
 for 66908 <at> debbugs.gnu.org; Fri, 03 Nov 2023 12:23:27 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 239A5442E70;
 Fri,  3 Nov 2023 12:22:45 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699028564;
 bh=3rh/oGNyC5mpJxihX5dxF+DQaTzl3ezrffoFDX9eS+0=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=J2woRffUgyRJdwPDSBBPHu49BYp9jDlQIRCcYUY6SWcy4R3PkE27TDuXirgtPFMsj
 AX9x+1UZvs3dgweWB8eeBJRX/1ljU4o9z2yawRhgVPRIDGuuBTDf/3u3WWw5voQt9T
 Sj1j3YndZ6OPidfJUnPinCqcOyZFm3pzTgjaWEP2elgmus5SqWwo1z2aG+Xw8Ho6sn
 R7wMPqtYLqjgoWmZ3YFmLs33E927yWYYCxH7s0goioIbFYdI9Cg3wxPM2qDYnQl47e
 M4JWgRYYjzrbXJK33vjI/7Few+4VDucBvdBxY+oNze8Wbvs3/wKHuzKI4iMr/2FCUl
 gXwD+I4vmE6lQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0796F442E6E;
 Fri,  3 Nov 2023 12:22:44 -0400 (EDT)
Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CF15212022A;
 Fri,  3 Nov 2023 12:22:43 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#66908: Exposing more public nadvice API
In-Reply-To: <878r7fw802.fsf@HIDDEN> (Philip Kaludercic's message of "Fri, 
 03 Nov 2023 08:34:05 +0000")
Message-ID: <jwvpm0qq0nu.fsf-monnier+emacs@HIDDEN>
References: <878r7fw802.fsf@HIDDEN>
Date: Fri, 03 Nov 2023 12:22:42 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.010 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66908
Cc: 66908 <at> debbugs.gnu.org, Visuwesh <visuweshm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.3 (---)

> I would like to ask if it would be possible to have a public and
> "official" way to access information about advised functions, since all
> the accessory functions defined by `oclosure-define' appear to be marked
> as internal.

[ `oclosure-define` always define accessors as internal, indeed.
  I decided it was simpler this way, since it's easy enough to add
  aliases for those accessors we want to export.  ]

> Specifically `advice-cd*r' would be useful,

It's clearly the internal function most frequently used outside of
`nadvice.el`, indeed.
I think it'd be OK to promote that function to a non-internal name.

> though it might be that we (Visuwesh and I) are trying to do the wrong
> thing, since we want the return value to get a more sensible response
> from `func-arity' -- and I recall we had conversations about the
> complexity of this issue in the past before.

There are very few places where `func-arity` can be used reliably,
indeed and most of those cases are better served by
`help-function-arglist`.

In the case where `func-arity` is used for backward compatibility
purposes (where reliability is not really possible anyway), I've
generally recommend the use of

    (condition-case nil
        ...
      (wrong-number-of-aruments
        ...))

instead.  It comes with its own failure modes, of course, but it's
usually easier to use and I found it to fail less often in practice
(because it's not affected by wrappers like those introduced by advice
or `apply-partially`).


        Stefan





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

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


Received: (at submit) by debbugs.gnu.org; 3 Nov 2023 08:34:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 03 04:34:56 2023
Received: from localhost ([127.0.0.1]:56717 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qypdo-0005rd-IO
	for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 04:34:56 -0400
Received: from lists.gnu.org ([2001:470:142::17]:45734)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1qypdj-0005rJ-QB
 for submit <at> debbugs.gnu.org; Fri, 03 Nov 2023 04:34:55 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1qypd4-0002Fj-P9
 for bug-gnu-emacs@HIDDEN; Fri, 03 Nov 2023 04:34:11 -0400
Received: from mout01.posteo.de ([185.67.36.65])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1qypd3-00062K-2K
 for bug-gnu-emacs@HIDDEN; Fri, 03 Nov 2023 04:34:10 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 6CCDA240027
 for <bug-gnu-emacs@HIDDEN>; Fri,  3 Nov 2023 09:34:06 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1699000446; bh=S7a2ELNEfNdwjDeRObtmaTNajDBmp/0Ux0rK0h34eC0=;
 h=From:To:Subject:Autocrypt:Date:Message-ID:MIME-Version:From;
 b=Vb2QhziRawmNW28CCJK7A4AjNc85iZqem/GgM5kcsiMPojK8BWx/05anVf3GW6yE0
 fmn/cmSvDPhNvIM1f8BSAPjnipOpiXdcQovuRmNpiIP0euSz/QR8JU27638ciH4Ebx
 Z1inPNa5KJFjQTuLJjVeJ0yRsjWE/7QoSEJkqeSXXZBUsDrAVih7Vebw7ZD6Gy6cgA
 ccshwT6sMR/WojYrTND6hT3jtPMi4k0tnSZVzI3lj3HSK64okHN2vOs/kanyF2rQ3n
 IQC8B9G89H7HBAt+XaFb5f6eHdekoBCH6BhVIRHV1x+K7z8qFTWEW2yInpxDVRMdL+
 PWMyba61YETQA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4SMDYT6wdKz9rxF
 for <bug-gnu-emacs@HIDDEN>; Fri,  3 Nov 2023 09:34:05 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Exposing more public nadvice API
X-Debbugs-CC: Stefan Monnier <monnier@HIDDEN>, Visuwesh
 <visuweshm@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; keydata=
 mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI
 BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
Date: Fri, 03 Nov 2023 08:34:05 +0000
Message-ID: <878r7fw802.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@HIDDEN;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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.0 (/)


I would like to ask if it would be possible to have a public and
"official" way to access information about advised functions, since all
the accessory functions defined by `oclosure-define' appear to be marked
as internal.

Specifically `advice-cd*r' would be useful, though it might be that we
(Visuwesh and I) are trying to do the wrong thing, since we want the
return value to get a more sensible response from `func-arity' -- and I
recall we had conversations about the complexity of this issue in the
past before.




Acknowledgement sent to Philip Kaludercic <philipk@HIDDEN>:
New bug report received and forwarded. Copy sent to monnier@HIDDEN, visuweshm@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to monnier@HIDDEN, visuweshm@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#66908; 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: Sat, 20 Jan 2024 12:30:02 UTC

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