Subject: Re: bug#66908: Exposing more public nadvice API

From: Stefan Monnier <[email-masked]>
Date: Sat, 04 Nov 2023 11:55:50 -0400

> 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