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

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

bug#65797: `buffer-match-p` should not use `func-arity`


From: Dmitry Gutov
Subject: bug#65797: `buffer-match-p` should not use `func-arity`
Date: Tue, 19 Sep 2023 19:13:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 19/09/2023 16:56, Philip Kaludercic wrote:
Dmitry Gutov<dmitry@gutov.dev>  writes:

On 19/09/2023 11:34, Philip Kaludercic wrote:
[ BTW, changing the code to use `&rest args` instead of `&optional arg`
    would help for this, right?  ]
How come?
In project.el buffer-match-p would be called without an extra
argument, so the predicates would be called without an extra argument
as well.

That should take care of that compatibility, I think.
But what does that have to do with &rest vs &optional?

Stringly speaking, nothing, because you can manage the same scheme with &optional - just dispatching to pred with different number of arguments depending on whether the &optional arg is nil. Though that breaks a little when nil is a meaningful value (probably a rare case).

Rewriting the function in terms of &rest just makes this solution the most natural one, I suppose.

Though we'll still have to document the distinction in the docstrings of project-kill-buffer-conditions and etc (the number of the arguments called with).





reply via email to

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