bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66908: Exposing more public nadvice API


From: Stefan Monnier
Subject: bug#66908: Exposing more public nadvice API
Date: Sat, 04 Nov 2023 02:14:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>> 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))) ;; 
> ⇒ (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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]