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#57502: 29.0.50; Issue with `or' clause of buffer-match-p Date: Wed, 31 Aug 2022 12:47:07 +0000 Message-ID: <87ilm87f78.fsf@posteo.net> References: <87o7w0fwnt.fsf@gmail.com> 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="30672"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57502@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 31 14:48:59 2022 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 1oTN9P-0007ix-3F for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 14:48:59 +0200 Original-Received: from localhost ([::1]:56948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTN9M-0002Cu-Bs for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 08:48:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTN8U-0002Ag-H1 for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:48:15 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTN8T-0000DB-VY for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTN8T-0001Zt-SG for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:48: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: Wed, 31 Aug 2022 12:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57502 X-GNU-PR-Package: emacs Original-Received: via spool by 57502-submit@debbugs.gnu.org id=B57502.16619500435894 (code B ref 57502); Wed, 31 Aug 2022 12:48:01 +0000 Original-Received: (at 57502) by debbugs.gnu.org; 31 Aug 2022 12:47:23 +0000 Original-Received: from localhost ([127.0.0.1]:38483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTN7q-0001X0-TG for submit@debbugs.gnu.org; Wed, 31 Aug 2022 08:47:23 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:58921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTN7i-0001Wf-VR for 57502@debbugs.gnu.org; Wed, 31 Aug 2022 08:47:21 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0B387240028 for <57502@debbugs.gnu.org>; Wed, 31 Aug 2022 14:47:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1661950029; bh=SjbFDOdzDtLRQiIE41iWY1VHCqk7UraOy6dzXp5nfSA=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Jxj22jbWv0I+fsEW+lJHu6p8CKj4NgSvvVuEiMjxuxBg272zlHHTR0aC9Na6k2sY3 7wOFxtKkkUyPyjKBagP+89uhUuCI4cTIQs7CGCL6ssB6K2sBDTkGTdf/GzzABPYhEG WB2eEWc3nxrbuiERaUHjmDT2RqOjKkZAbRiSvxyONFFxSz5euNIZZl0IKM2VXTXbZJ eWiYBLg3aRnVLjnGGVwQd8/I7Ao+yHxdtwps5QwoEoJLp0yfU4QfwucGymBR+zujwc zTYMebTQn3utcqi48qeZBMrioJ1rtvl4RuQUUzhmsbCNNX0f8U7Po/MvpqjHG9bYcb sor9mQ4RcWd+g== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MHkTS3Mm2z9rxT; Wed, 31 Aug 2022 14:47:08 +0200 (CEST) In-Reply-To: <87o7w0fwnt.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 31 Aug 2022 14:02:46 +0200") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB 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" Xref: news.gmane.io gmane.emacs.bugs:241192 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Augusto Stoffel writes: > This buffer-match-p condition does the expected job: > > (buffer-match-p '(or "\\*" (derived-mode . special-mode)) > (current-buffer)) > > But this presumably equivalent one gives a =E2=80=9C(wrong-type-argument = listp > special-mode)=E2=80=9D error: > > (buffer-match-p '(or (and "\\*") > (derived-mode . special-mode)) > (current-buffer)) It seems to me that the issue is related to the `and' being wrapped by an `or', specifically because of a typo in the handling of `and': --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/subr.el b/lisp/subr.el index 2ffc594997..0350c16ccf 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -7014,8 +7014,8 @@ buffer-match-p (funcall match (cdr condition))) ((eq (car-safe condition) 'and) (catch 'fail - (dolist (c (cdr conditions)) - (unless (funcall match c) + (dolist (c (cdr condition)) + (unless (funcall match (list c)) (throw 'fail nil))) t))) (throw 'match t))))))) --=-=-= Content-Type: text/plain As you have pointed out to me privately, it might make sense to rewrite the case distinction using pcase, to avoid simple mistakes like these. --=-=-=--