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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 65797 <at> debbugs.gnu.org, dmitry <at> gutov.dev, philipk <at> posteo.net, mattias.engdegard <at> gmail.com, joseph <at> breatheoutbreathe.in
Subject: bug#65797: `buffer-match-p` should not use `func-arity`
Date: Sun, 15 Oct 2023 09:13:27 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: dmitry <at> gutov.dev,  joseph <at> breatheoutbreathe.in,  philipk <at> posteo.net,
>   mattias.engdegard <at> gmail.com,  65797 <at> debbugs.gnu.org
> Date: Sat, 14 Oct 2023 10:31:29 -0400
> 
> > What bad things will happen if we leave emacs-29 with no changes?
> 
> Nothing too serious.
> `buffer-match-p` is new in Emacs-29 and it is documented (in the Texinfo,
> not in the docstring) to provide a behavior we're unable to implement.
> So the main aim of the patch is to "fix" this new API so it can be
> implemented as documented.
> 
> But the problem is somewhat corner-case, so it's not super urgent to fix it.
> 
> OTOH, the change is minor and fairly safe.
> Basically the patch replaces an &optional with a &rest in the API.
> Besides allowing more cases (which is mostly a non-issue in terms of
> backward compatibility), this introduces just 1 potential problem:
> 
> When `buffer-match-p` is called without the formerly optional arg, it
> will call the predicate functions with one fewer arg than before.
> 
> The Emacs-29.1 code has a hack that tries to detect when the predicate
> expects "one fewer arg" and if so calls it without the optional arg, so
> I just extended that hack to also handle that reverse problem (when
> there is one fewer arg than expected by the function).
> 
> If we put it into `master`, I guess we can stick to the original hack
> and hope the above "just 1 potential problem" won't bite us, but it
> seems we may as well use the more backward compliant option and put it
> into `emacs-29`.
> 
> See below my current "safe" choice.

Sigh.  I guess we can install this on emacs-29 and cross the
fingers...




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.