From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#62417: ; Regression: 59ecf25fc860 is the first bad commit Date: Sat, 25 Mar 2023 13:17:40 +0000 Message-ID: <878rfl3r7v.fsf@posteo.net> References: <87sfducmrc.fsf@gmail.com> <87o7oicgy4.fsf@gmail.com> <87wn365e3t.fsf@posteo.net> <87pm8yaq24.fsf_-_@gmail.com> <83fs9tc7o9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8884"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 62417@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 14:18:15 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 1pg3mh-000229-14 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 14:18:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg3mY-00013T-Uw; Sat, 25 Mar 2023 09:18:06 -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 1pg3mU-00013D-PM for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 09:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg3mU-0001zq-Gm for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 09:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg3mT-0006Sc-V4 for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 09:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2023 13:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62417 X-GNU-PR-Package: emacs Original-Received: via spool by 62417-submit@debbugs.gnu.org id=B62417.167975027224820 (code B ref 62417); Sat, 25 Mar 2023 13:18:01 +0000 Original-Received: (at 62417) by debbugs.gnu.org; 25 Mar 2023 13:17:52 +0000 Original-Received: from localhost ([127.0.0.1]:42144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg3mK-0006SF-9s for submit@debbugs.gnu.org; Sat, 25 Mar 2023 09:17:52 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:54601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg3mI-0006S2-JQ for 62417@debbugs.gnu.org; Sat, 25 Mar 2023 09:17:51 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A2A78240142 for <62417@debbugs.gnu.org>; Sat, 25 Mar 2023 14:17:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1679750264; bh=HCQ7TniGP7BH7oQjYurE+EpIY7e/sL3MS46xXqbTGlU=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=XYMg40KgoRqlkH+C5gb9iID/jP956bRT8/Ro1isj3YB4EBGOAjDn5CG21SYfe67ms Ih2TS80tmUtMuMI4TAh8+bmSVnLC2lCOu8Bl0HeBisr1o1YNMj7sRMwUTqGXT9LTz8 H2tFVFBj6lF/KHtaX+ehGoDY0RTQX3r2SUQjwN4Pk80CT/8D2S6zLV4Q4KkI3eEw92 K0U/ivZhvYS2u3Jh/ieKDo9wetNIZd4EdCWoqr8BWcP5GmFhzt2eajBW8w8xQL8r0J rdAWS5Emd6+3q0sec3dMWNFVY0aHRjbt2XJNp+ss2eQzm8IO8hc7bse83hBDHGYTT4 MxytRPgxNlNaQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PkKPc570Fz9rxB; Sat, 25 Mar 2023 14:17:40 +0100 (CET) In-Reply-To: <83fs9tc7o9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Mar 2023 15:55:02 +0300") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:258564 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> Cc: 62417@debbugs.gnu.org >> From: Jo=C3=A3o T=C3=A1vora >> Date: Fri, 24 Mar 2023 19:48:35 +0000 >>=20 >> If the previous explanation is somehow hard to understand, here's a >> hopefully simpler one with a repro which doesn't require SLY. In Emacs >> 28 the docstring for `display-buffer-alist` states (emphasis mine): >>=20 >> If non-nil, this is an alist of elements (CONDITION . ACTION), >> where: >>=20=20=20=20=20 >> CONDITION is either a regexp matching buffer names, or a >> function that takes two arguments - a buffer name and the >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> ACTION argument of `display-buffer' - and returns a boolean. >>=20 >> In Emacs 29, the docstring was changed to state: >>=20 >> If non-nil, this is an alist of elements (CONDITION . ACTION), >> where: >>=20=20=20=20=20=20 >> CONDITION is passed to `buffer-match-p', along with the buffer >> that is to be displayed and the ACTION argument of >> `display-buffer', to check if ACTION should be used. >>=20 >> Any code that was written for the Emacs 28 contract in mind like, for >> example: >>=20 >> (defun foop (buffer-name _alist) (string-match "foop" buffer-name)) >>=20 >> (add-to-list 'display-buffer-alist '(foop . display-buffer-other-fram= e)) >>=20 >> Will now fail with an obscure error message. I've checked "Incompatible >> Lisp Changes in Emacs 29.1" in etc/NEWS and could not find a mention to >> this, so I assume it was not intentional. >>=20 >> So it is most clearly a regression. > > There's something missing in the above description, since > buffer-match-p accepts a function as its CONDITION argument, and calls > that function with the buffer and ACTION.=20=20 We would have to call the function with the buffer name instead of the buffer object. So the `buffer-match-p' fix would look like this: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/subr.el b/lisp/subr.el index 99ddd813867..3210ab05702 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -7140,8 +7140,8 @@ buffer-match-p (string-match-p condition (buffer-name buffer))) ((pred functionp) (if (eq 1 (cdr (func-arity condition))) - (funcall condition buffer) - (funcall condition buffer arg))) + (funcall condition (buffer-name buffer)) + (funcall condition (buffer-name buffer) arg))) (`(major-mode . ,mode) (eq (buffer-local-value 'major-mode buffer) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I don't think I am a fan of this, as most of the time a buffer is more immediately useful. Perhaps Jo=C3=A3o's initial change would be better in that case, for the sake of backwards compatibility? Or does it make sense to mention this as an incompatible lisp change? > So it sounds like code > written for Emacs 28 should still work. What is missing here that > explains the breakage? --=20 Philip Kaludercic --=-=-=--