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: Fri, 03 Nov 2023 12:22:42 -0400 Message-ID: References: <878r7fw802.fsf@posteo.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30051"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66908@debbugs.gnu.org, Visuwesh To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 03 17:24:28 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 1qywyB-0007aJ-Vx for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Nov 2023 17:24:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qywxI-00039r-8e; Fri, 03 Nov 2023 12:23:32 -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 1qywxC-00039Z-Kn for bug-gnu-emacs@gnu.org; Fri, 03 Nov 2023 12:23:28 -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 1qywxC-0001mQ-0Y for bug-gnu-emacs@gnu.org; Fri, 03 Nov 2023 12:23:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qywxl-0007ez-Ik for bug-gnu-emacs@gnu.org; Fri, 03 Nov 2023 12:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Nov 2023 16:24:01 +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.169902860929373 (code B ref 66908); Fri, 03 Nov 2023 16:24:01 +0000 Original-Received: (at 66908) by debbugs.gnu.org; 3 Nov 2023 16:23:29 +0000 Original-Received: from localhost ([127.0.0.1]:59595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qywxF-0007dh-EF for submit@debbugs.gnu.org; Fri, 03 Nov 2023 12:23:29 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qywxC-0007dS-LO for 66908@debbugs.gnu.org; Fri, 03 Nov 2023 12:23:27 -0400 Original-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== Original-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) Original-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) In-Reply-To: <878r7fw802.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 03 Nov 2023 08:34:05 +0000") 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:273714 Archived-At: > 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