From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 66908@debbugs.gnu.org, Visuwesh <visuweshm@gmail.com>
Subject: bug#66908: Exposing more public nadvice API
Date: Fri, 03 Nov 2023 12:22:42 -0400 [thread overview]
Message-ID: <jwvpm0qq0nu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <878r7fw802.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 03 Nov 2023 08:34:05 +0000")
> 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
next prev parent reply other threads:[~2023-11-03 16:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 8:34 bug#66908: Exposing more public nadvice API Philip Kaludercic
2023-11-03 16:22 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-11-03 18:50 ` Visuwesh
2023-11-03 19:24 ` Drew Adams
2023-11-03 22:05 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 2:48 ` Visuwesh
2023-11-04 6:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 6:28 ` Visuwesh
2023-11-04 8:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 9:58 ` Philip Kaludercic
2023-11-04 15:55 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvpm0qq0nu.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=66908@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=philipk@posteo.net \
--cc=visuweshm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).