From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66908: Exposing more public nadvice API Date: Sat, 04 Nov 2023 02:14:46 -0400 Message-ID: References: <878r7fw802.fsf@posteo.net> <87msvufz8n.fsf@gmail.com> <875y2ifd2c.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6393"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Philip Kaludercic , 66908@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 04 07:15:57 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qz9wq-0001S4-UA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Nov 2023 07:15:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qz9wZ-00015t-Og; Sat, 04 Nov 2023 02:15:39 -0400 Original-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 ) id 1qz9wV-00014P-UU for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 02:15:36 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qz9wM-0003fj-3B for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 02:15:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qz9ww-0003x1-1v for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 02:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Nov 2023 06:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66908 X-GNU-PR-Package: emacs Original-Received: via spool by 66908-submit@debbugs.gnu.org id=B66908.169907853215131 (code B ref 66908); Sat, 04 Nov 2023 06:16:02 +0000 Original-Received: (at 66908) by debbugs.gnu.org; 4 Nov 2023 06:15:32 +0000 Original-Received: from localhost ([127.0.0.1]:60255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz9wS-0003vx-8g for submit@debbugs.gnu.org; Sat, 04 Nov 2023 02:15:32 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz9wQ-0003vl-Io for 66908@debbugs.gnu.org; Sat, 04 Nov 2023 02:15:31 -0400 Original-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== Original-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) Original-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) In-Reply-To: <875y2ifd2c.fsf@gmail.com> (Visuwesh's message of "Sat, 04 Nov 2023 08:18:59 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273742 Archived-At: >> 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