From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65797: `buffer-match-p` should not use `func-arity` Date: Sun, 15 Oct 2023 09:13:27 +0300 Message-ID: <831qdwqupk.fsf@gnu.org> References: <87v8cmct9b.fsf@breatheoutbreathe.in> <87sf7o38g1.fsf_-_@posteo.net> <871qf1rbdo.fsf@posteo.net> <87o7hz4zg2.fsf@posteo.net> <87sf7b8ker.fsf@posteo.net> <87y1h2blxq.fsf@posteo.net> <874jjqb715.fsf@posteo.net> <0371b6ff-58e4-961e-29c9-4efb65b82185@gutov.dev> <87v8bhtr3k.fsf@breatheoutbreathe.in> <3a282a0b-3efa-ec12-2143-0496ebf6c828@gutov.dev> <831qdxu3y8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1916"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65797@debbugs.gnu.org, dmitry@gutov.dev, philipk@posteo.net, mattias.engdegard@gmail.com, joseph@breatheoutbreathe.in To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 15 08:14:57 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qruOv-0000IH-10 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Oct 2023 08:14:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qruOe-0006HE-1v; Sun, 15 Oct 2023 02:14:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qruOc-0006GM-Av for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 02:14:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qruOc-0003OK-33 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 02:14:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qruOz-0006YC-QZ for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 02:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2023 06:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65797 X-GNU-PR-Package: emacs Original-Received: via spool by 65797-submit@debbugs.gnu.org id=B65797.169735045925117 (code B ref 65797); Sun, 15 Oct 2023 06:15:01 +0000 Original-Received: (at 65797) by debbugs.gnu.org; 15 Oct 2023 06:14:19 +0000 Original-Received: from localhost ([127.0.0.1]:51118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qruOI-0006X2-Kf for submit@debbugs.gnu.org; Sun, 15 Oct 2023 02:14:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qruOG-0006Wo-7N for 65797@debbugs.gnu.org; Sun, 15 Oct 2023 02:14:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qruNj-0003Ky-Ag; Sun, 15 Oct 2023 02:13:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Luuc9s8c38vXDrRK1w2lnMzjN2cuYh1tls8aOr8lLks=; b=XYDkGJF8Mdh6 gfNyam/wYmsF8rPVTTFcQ11zb8eISo1+VYU1GYKUaoWd0e2z4fTQHTgqxdccoNT8rzXO2Gs2vxj4A PGwPVp5/wv9zg1AaiaM81SPHxuntchMnLGo2aFEbuV1XY/hnCuEFWj0cbuRcFYaI46cxMIklO5z0T cNruGleRN0CJTLjNON7qK4sWTJMdlNOYqAAT51+sYSeUisCHQQ02DxhsI0K0IHy6IP3BwgKcDktFl lHE7xmYNK/Sg8O2Mez08eqP4xMjz/74fq+gchxagBV5Hqg0qIRMby6NiP3JhP+CcM4HHkrBaS1or1 5o9Ai7EHOYibU6MxUUHuWg==; In-Reply-To: (message from Stefan Monnier on Sat, 14 Oct 2023 10:31:29 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272486 Archived-At: > From: Stefan Monnier > Cc: dmitry@gutov.dev, joseph@breatheoutbreathe.in, philipk@posteo.net, > mattias.engdegard@gmail.com, 65797@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...