GNU bug report logs - #65797
`buffer-match-p` should not use `func-arity`

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Thu, 7 Sep 2023 07:56:02 UTC

Severity: normal

Found in version 29.0.92

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #106 received at 65797 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 65797 <at> debbugs.gnu.org, Philip Kaludercic <philipk <at> posteo.net>,
 Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#65797: `buffer-match-p` should not use `func-arity`
Date: Sun, 08 Oct 2023 02:10:33 -0700
Dmitry Gutov <dmitry <at> gutov.dev> writes:

> On 19/09/2023 16:56, Philip Kaludercic wrote:
>> Dmitry Gutov<dmitry <at> 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.

I am in favor of this solution as well.

> 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).

How do the project.el docstrings need to be updated?

Thank you!

Joseph




This bug report was last modified 1 year and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.