From unknown Sun Aug 17 22:06:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57502 <57502@debbugs.gnu.org> To: bug#57502 <57502@debbugs.gnu.org> Subject: Status: 29.0.50; Issue with `or' clause of buffer-match-p Reply-To: bug#57502 <57502@debbugs.gnu.org> Date: Mon, 18 Aug 2025 05:06:14 +0000 retitle 57502 29.0.50; Issue with `or' clause of buffer-match-p reassign 57502 emacs submitter 57502 Augusto Stoffel severity 57502 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 08:02:58 2022 Received: (at submit) by debbugs.gnu.org; 31 Aug 2022 12:02:58 +0000 Received: from localhost ([127.0.0.1]:38444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTMQr-0000RZ-PG for submit@debbugs.gnu.org; Wed, 31 Aug 2022 08:02:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:46302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTMQn-0000RO-1U for submit@debbugs.gnu.org; Wed, 31 Aug 2022 08:02:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTMQm-0007vV-M9 for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:02:52 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:46976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTMQl-0008PQ-3a for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:02:52 -0400 Received: by mail-ej1-x635.google.com with SMTP id bj12so27849723ejb.13 for ; Wed, 31 Aug 2022 05:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :subject:to:from:from:to:cc; bh=KESpQZoE5Xbt/OjjA5CaZEWHdwI3FkE+3k/twLdcvEA=; b=F3qYJuBGNjDkwBFX3fM3zAyFEmb4aADN4UAMj9AQ4CazJBJNae61Z70nM63bpX7K/G NWhfuLrZeo3ap7wA115ghvDJt3cTqI/dqwK0hf5alKoJs8d4Mp0c09r56HNTRIClSDTg fV4Zuhg3atcV3cN0BFqhtp/gJ7qimYTaz9s1VPoEhKPrTCZ6PhwQ9vUE9tP4PIX8xryQ GcRNP4vkstTXt1Zb6sTiNxrCdvz98lR9h6VVHNHNLgKVxo1USfP/4LMZAduxrmLm9lbP 4lGP1LktDO6Px2dV4axzTsHDf7HQ8ugejL9krHFfYoeS8b831RTx8xB1I+mYhy0ebP/s FgJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :subject:to:from:x-gm-message-state:from:to:cc; bh=KESpQZoE5Xbt/OjjA5CaZEWHdwI3FkE+3k/twLdcvEA=; b=LU205Rx7aHtROL7bJV0fxrafYUwpogw9FTxS81mSjG0WLBJf2XgQ7A9YTH9D98Qq0r rXkafkyHp14GT1TL5EHAK7zANslzTn3LHj56ZgbZ9GjMD3J8inLNhwSGAIAxRAikJFF+ bkcj2US5aDLjYabOlR4bOkmonKOUPmB/gC9vC8tQnEXPOCS9EHE2Y9f4RLAVaeTUApur koYe+83tWEVsGTJuJeu18JC8utki+Ez6rWKCVxYpmT14p/Bt2/2NAa9m5K+asrsNUwVd yEi7R4+XJ4/myuewbFyyhR3RWZ6O1H/I9ORFTEsxp1/gbiF5jxpKWoFz3pVJTiNQ1Jjo BSGg== X-Gm-Message-State: ACgBeo3omYmZGoh9AM9NiahdYfUl4uV6dyBvUu3bty0a84il6g2GI0rd 1EK02a7ZWoFbTDqxTVqX9/jDFDf4s/4= X-Google-Smtp-Source: AA6agR6c5AjJtIEnRurlEU0Wf+lOSZxNG5ILdR++9ZZEXaqrZudx2MffGYAO0y6kxWsBQ9bzi8QLrg== X-Received: by 2002:a17:907:8692:b0:730:b0d3:5311 with SMTP id qa18-20020a170907869200b00730b0d35311mr20764144ejc.674.1661947368415; Wed, 31 Aug 2022 05:02:48 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::157b]) by smtp.gmail.com with ESMTPSA id b11-20020a17090630cb00b0072b92daef1csm7100681ejb.146.2022.08.31.05.02.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 05:02:47 -0700 (PDT) From: Augusto Stoffel To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Issue with `or' clause of buffer-match-p Date: Wed, 31 Aug 2022 14:02:46 +0200 Message-ID: <87o7w0fwnt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=arstoffel@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 li= stp special-mode)=E2=80=9D error: (buffer-match-p '(or (and "\\*") (derived-mode . special-mode)) (current-buffer)) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 08:47:23 2022 Received: (at 57502) by debbugs.gnu.org; 31 Aug 2022 12:47:23 +0000 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 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 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== 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) From: Philip Kaludercic To: Augusto Stoffel Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <87o7w0fwnt.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 31 Aug 2022 14:02:46 +0200") References: <87o7w0fwnt.fsf@gmail.com> 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 Date: Wed, 31 Aug 2022 12:47:07 +0000 Message-ID: <87ilm87f78.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= 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. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 08:50:25 2022 Received: (at 57502) by debbugs.gnu.org; 31 Aug 2022 12:50:25 +0000 Received: from localhost ([127.0.0.1]:38496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTNAm-0001fO-V1 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 08:50:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]:54557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTNAk-0001f6-1O for 57502@debbugs.gnu.org; Wed, 31 Aug 2022 08:50:23 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 12D6C240101 for <57502@debbugs.gnu.org>; Wed, 31 Aug 2022 14:50:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1661950216; bh=qpfizfo5xpvPsn20O7SWZGO1LYK24uyLA5RsF6b15g8=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=glDZvfZa9vXDz5FnSFU0/EOE+nwazgYOJcM0BWh3B/sgQ6dDr3mTKYkfv5Fxig6VH VFYADOEHmI2rTta91Bkps9YQ+WIlQ85tD5jubTHUC4HZ3wtwD2rMEOz09aqCAZ49zE hCWZnBBn2y2AjbRMyXzlpgzsMLDiFgnz0xFLnyBOZqFjyi+XEGAHw5Q2ozOqpnI56Z LjbsQ0+Nndio5J5mI/9WbQliK/hU8cPvJ324cIoaNn88ETHfZ6fHnShw9PivtHnYqt Ylk0S/a4BhoPUOBzw/EfXjFI+qzQ7uRFhv6tW6GmU6ZYgSpBuGLbAsZgXCPOGfnpVt +NAEUVcasbbvw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MHkY24fpYz9rxb; Wed, 31 Aug 2022 14:50:14 +0200 (CEST) From: Philip Kaludercic To: Augusto Stoffel Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <87ilm87f78.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 31 Aug 2022 12:47:07 +0000") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> 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 Date: Wed, 31 Aug 2022 12:50:14 +0000 Message-ID: <878rn47f21.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > 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': > > 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))))))) > > > 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. That might look something like this: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/subr.el b/lisp/subr.el index 2ffc594997..db1dc25044 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6992,32 +6992,32 @@ buffer-match-p (lambda (conditions) (catch 'match (dolist (condition conditions) - (when (cond - ((eq condition t)) - ((stringp condition) - (string-match-p condition (buffer-name buffer))) - ((functionp condition) - (if (eq 1 (cdr (func-arity condition))) - (funcall condition buffer) - (funcall condition buffer arg))) - ((eq (car-safe condition) 'major-mode) - (eq - (buffer-local-value 'major-mode buffer) - (cdr condition))) - ((eq (car-safe condition) 'derived-mode) - (provided-mode-derived-p - (buffer-local-value 'major-mode buffer) - (cdr condition))) - ((eq (car-safe condition) 'not) - (not (funcall match (cdr condition)))) - ((eq (car-safe condition) 'or) - (funcall match (cdr condition))) - ((eq (car-safe condition) 'and) - (catch 'fail - (dolist (c (cdr conditions)) - (unless (funcall match c) - (throw 'fail nil))) - t))) + (when (pcase condition + ('t t) + ((pred stringp) + (string-match-p condition (buffer-name buffer))) + ((pred functionp) + (if (eq 1 (cdr (func-arity condition))) + (funcall condition buffer) + (funcall condition buffer arg))) + (`(major-mode . ,mode) + (eq + (buffer-local-value 'major-mode buffer) + mode)) + (`(derived-mode . ,mode) + (provided-mode-derived-p + (buffer-local-value 'major-mode buffer) + mode)) + (`(not . cond) + (not (funcall match cond))) + (`(or . ,args) + (funcall match args)) + (`(and . ,args) + (catch 'fail + (dolist (c args) + (unless (funcall match (list c)) + (throw 'fail nil))) + t))) (throw 'match t))))))) (funcall match (list condition)))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 12:22:26 2022 Received: (at 57502) by debbugs.gnu.org; 31 Aug 2022 16:22:26 +0000 Received: from localhost ([127.0.0.1]:40315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTQTy-0001Ef-7U for submit@debbugs.gnu.org; Wed, 31 Aug 2022 12:22:26 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:33769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTQTw-0001EQ-39 for 57502@debbugs.gnu.org; Wed, 31 Aug 2022 12:22:24 -0400 Received: by mail-ed1-f45.google.com with SMTP id w2so3587120edc.0 for <57502@debbugs.gnu.org>; Wed, 31 Aug 2022 09:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc; bh=D+T8xwIWYqtiDMsXihCYAuXg7d4ORFP5ARNvtp5n368=; b=JPetnjbhjaK1rXqkFCIpJjA6MpwJShfVE1vF61DHFIPhYJp/vfbGBxi5HpxRXwfojk 75M2rGzYtRDBXnpjQ+xumD8ER1fK7sYpk6tSKNC9d2640euVB20YAgbrMssu7SbQwQce YHHLwulkaXMuyxlDCuQstpoGelAAAfLE90ItQhOh4fR/yqAHo9cCgZeMMd2cEqTxunTO XbIqz4b5uPuXbAM7noI9KZRsCAztJkwO2puF/lHDSMfWs7s2bsP67Do8DUHFNi3jKsVA 1vMv70oI5UrwTRnKkLwXqVN0dCGrAXi/bX3/ZnkOUeneUGRGwBFSPixIz0eYq4pV3Quk 9P0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=D+T8xwIWYqtiDMsXihCYAuXg7d4ORFP5ARNvtp5n368=; b=E24P9f0D+i0M4gVn2q7SwJwRGRnZWmbKEVX0xuK+Hz036+Ei77OaonMw9s92KDIIK9 in+Fgg0VP64NwOcpjYAEphhze16IoWOMRZORnOr4/Diy+t0O/S7a02a3inOSIirf9n1/ 20anNuVlQ2SZQBGJOUOCHy8/YrgIZ6aUpRNiy8kwgo/4Q5o828cUOIn0VSEfwsT5pG7p /oQjxqMjRHzR23YoTzbzODBE1Jp+Uuf4PxqhalBA8VC3jICjhpXKBc+LFEGGc1DJfr6q fiX0YJEmt4+4tjRpGUg8j6fk8TnRj+sO8xBnfkURAVPj1m01oM7FtOtE/A82740NDHWd AX6g== X-Gm-Message-State: ACgBeo1IAeNjKtzZVgb7Lac50OxKvZs9USj40jP3hhjN3ZscnRJIyspc EwBEizEttDB7XmeqD0ZMgmDZxvee8Bg= X-Google-Smtp-Source: AA6agR53qeThGYOMpe9oTVkLYIjU8sRDh3SxNgFJ8EWtqJ0oX5X6lIfwDsRpd1Y6bgOpVj+dSTghRw== X-Received: by 2002:a05:6402:2549:b0:448:6db8:9d83 with SMTP id l9-20020a056402254900b004486db89d83mr12937628edb.194.1661962937902; Wed, 31 Aug 2022 09:22:17 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::157b]) by smtp.gmail.com with ESMTPSA id c2-20020a17090618a200b0073d71b7527asm7195077ejf.151.2022.08.31.09.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 09:22:16 -0700 (PDT) From: Augusto Stoffel To: Philip Kaludercic Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <878rn47f21.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 31 Aug 2022 12:50:14 +0000") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> Date: Wed, 31 Aug 2022 18:22:15 +0200 Message-ID: <87k06o4c3s.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, 31 Aug 2022 at 12:50, Philip Kaludercic wrote: > That might look something like this: > [...] > + (`(derived-mode . ,mode) > + (provided-mode-derived-p > + (buffer-local-value 'major-mode buffer) > + mode)) On a tangent, wouldn't it be nice to allow a list of modes? That is, > + (`(derived-mode . ,modes) > + (apply #'provided-mode-derived-p > + (buffer-local-value 'major-mode buffer) > + modes)) (with some extra care to keep backwards compatibility). From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 12:30:38 2022 Received: (at 57502) by debbugs.gnu.org; 31 Aug 2022 16:30:38 +0000 Received: from localhost ([127.0.0.1]:40328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTQbu-0001SI-Ih for submit@debbugs.gnu.org; Wed, 31 Aug 2022 12:30:38 -0400 Received: from mout02.posteo.de ([185.67.36.66]:49981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTQbr-0001S2-Kd for 57502@debbugs.gnu.org; Wed, 31 Aug 2022 12:30:38 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B946124010A for <57502@debbugs.gnu.org>; Wed, 31 Aug 2022 18:30:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1661963429; bh=QETNOl7fXoUefcQ9DvHPFrtykFI0nuqxZi9StxufhJI=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=mNSUWMH7iIqfJViwOJ2m69pf75Cilv9cvyAo2E6dHKetcXE7IQHZIUQ7IIpZhmTcL Gq82SWdryAmyraBZc7ER5worRwarvNmP06BXUaZv6DE/ByuYU1BrjWl9IOLKqf1VwV TF/lJ0d1g2cMP4uvw35roZDHwntS1dJ6dCgMlwvK3BEnxAkTd3fkrUAj1QlxPscP7P bcng0I3qdQox69SsZxU/3cWFHBK/z1QWhV8zUInMDn0rkhnjA1SIsbwCvAnPF3hSiD xpAIoNZBEBa074wgk0Xrz8LKPG9AnLAAyJ1fer2GLQbWHoElJZca41iLO77WwvtbMd VqhK9jaPRvVMA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MHqR914sxz6tpV; Wed, 31 Aug 2022 18:30:28 +0200 (CEST) From: Philip Kaludercic To: Augusto Stoffel Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <87k06o4c3s.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 31 Aug 2022 18:22:15 +0200") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> <87k06o4c3s.fsf@gmail.com> 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 Date: Wed, 31 Aug 2022 16:30:23 +0000 Message-ID: <87czcg5qao.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Augusto Stoffel writes: > On Wed, 31 Aug 2022 at 12:50, Philip Kaludercic wrote: > >> That might look something like this: >> > [...] >> + (`(derived-mode . ,mode) >> + (provided-mode-derived-p >> + (buffer-local-value 'major-mode buffer) >> + mode)) > > On a tangent, wouldn't it be nice to allow a list of modes? That is, > >> + (`(derived-mode . ,modes) >> + (apply #'provided-mode-derived-p >> + (buffer-local-value 'major-mode buffer) >> + modes)) > > (with some extra care to keep backwards compatibility). Intuitively I feel as though this could be more problematic/confusing than convenient. If this is done, then it should be supported in every case, so that (and (derived-mode foo-mode) (major-mode . bar-mode)) (I know this is a stupid example) doesn't make someone want to try (and (derived-mode foo-mode) (major-mode bar-mode)) and be confused why it fails. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 07:04:30 2022 Received: (at 57502) by debbugs.gnu.org; 3 Sep 2022 11:04:30 +0000 Received: from localhost ([127.0.0.1]:41044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUQww-0007Ue-8r for submit@debbugs.gnu.org; Sat, 03 Sep 2022 07:04:30 -0400 Received: from mout02.posteo.de ([185.67.36.66]:59897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUQwu-0007UR-0r for 57502@debbugs.gnu.org; Sat, 03 Sep 2022 07:04:29 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DBE93240104 for <57502@debbugs.gnu.org>; Sat, 3 Sep 2022 13:04:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1662203061; bh=Iclxmrgmy68+20jmdAcPN+L2s2nY2keSsQ22Ga1+Wxg=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=liMr6pY8FAtJAqfrLrPTtx6uSLBvAlXyIlo/Sl46AKB2LmQXlVZ+d8bel4Gfla2fC BmsOvlIhkUwy4W/YJUCfLozQWyWnJgCHp8BQQw+8YZqzwmb2S7CIcDnHoIiRiTGrnX 4bfe8slKFS9fjof3I92beDUWDy/J3Y9EaLHx6VSrP/4UIAJJ6iM7K+81UgEWTTK1o2 hNTezI5YKmnwyTu2yF+D7DO8wbNcgHHjlU4NWTWZPgU6oZGlB6UGLqNmfByTuYfAxf gP6mXGx1lKuz7CSRB/LP5JJfcOrm4uQArG9c6dKtRuWzHciLSZLuzGLjOgi4Nug3L8 +AUMLHG3GNZZw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MKX3T1pgxz9rxM; Sat, 3 Sep 2022 13:04:21 +0200 (CEST) From: Philip Kaludercic To: Augusto Stoffel Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <878rn47f21.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 31 Aug 2022 12:50:14 +0000") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> 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 Date: Sat, 03 Sep 2022 11:04:20 +0000 Message-ID: <87edwsk9cb.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > Philip Kaludercic writes: > >> 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-argumen= t 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': >> >> 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))))))) >> >> >> 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. > > That might look something like this: > > diff --git a/lisp/subr.el b/lisp/subr.el > index 2ffc594997..db1dc25044 100644 > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -6992,32 +6992,32 @@ buffer-match-p > (lambda (conditions) > (catch 'match > (dolist (condition conditions) > - (when (cond > - ((eq condition t)) > - ((stringp condition) > - (string-match-p condition (buffer-name buffer))) > - ((functionp condition) > - (if (eq 1 (cdr (func-arity condition))) > - (funcall condition buffer) > - (funcall condition buffer arg))) > - ((eq (car-safe condition) 'major-mode) > - (eq > - (buffer-local-value 'major-mode buffer) > - (cdr condition))) > - ((eq (car-safe condition) 'derived-mode) > - (provided-mode-derived-p > - (buffer-local-value 'major-mode buffer) > - (cdr condition))) > - ((eq (car-safe condition) 'not) > - (not (funcall match (cdr condition)))) > - ((eq (car-safe condition) 'or) > - (funcall match (cdr condition))) > - ((eq (car-safe condition) 'and) > - (catch 'fail > - (dolist (c (cdr conditions)) > - (unless (funcall match c) > - (throw 'fail nil))) > - t))) > + (when (pcase condition > + ('t t) > + ((pred stringp) > + (string-match-p condition (buffer-name buffer))) > + ((pred functionp) > + (if (eq 1 (cdr (func-arity condition))) > + (funcall condition buffer) > + (funcall condition buffer arg))) > + (`(major-mode . ,mode) > + (eq > + (buffer-local-value 'major-mode buffer) > + mode)) > + (`(derived-mode . ,mode) > + (provided-mode-derived-p > + (buffer-local-value 'major-mode buffer) > + mode)) > + (`(not . cond) > + (not (funcall match cond))) > + (`(or . ,args) > + (funcall match args)) > + (`(and . ,args) > + (catch 'fail > + (dolist (c args) > + (unless (funcall match (list c)) > + (throw 'fail nil))) > + t))) > (throw 'match t))))))) > (funcall match (list condition)))) Are there any objections against applying this change? From what I see pcase is used elsewhere in seq, so it should be possible to recognise and expand the macro, right? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 07:11:40 2022 Received: (at 57502) by debbugs.gnu.org; 3 Sep 2022 11:11:40 +0000 Received: from localhost ([127.0.0.1]:41051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUR3s-0007f8-A4 for submit@debbugs.gnu.org; Sat, 03 Sep 2022 07:11:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUR3q-0007ew-TN for 57502@debbugs.gnu.org; Sat, 03 Sep 2022 07:11:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUR3k-0001Pu-IZ; Sat, 03 Sep 2022 07:11:32 -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=WxacksyUIUz60TFM9vaisD5mZEQ2ZfqyilUwhWe7go0=; b=Z2pbtCH5VKVO +21Y7xk4Pz+YZK6m/i2hUBzxRwnkIXdTuYd7MfLW1EJZ4irkVhNi3V5qHXvAF8c0UDa1PaKAQN7HG gWXVoJ+1yzjQe2QxWSXycuTXLaTewutv0EeniSi4jBwnuouGj1TBeLwosN4/O5A/Q6+dvWTe9Ng0o eV3NLNOSiPM1uguMDx6zxDBUfIw3WlNxD2kK+NjTJjaLF/UnTT0LfmtOAS+5/+mbpAH2/vbfbVhiP 7dWZbKopC/Q6FLJ3IOSVI96v2O4h9Xdc/im+UiUNLp0wVNVAcMK+4Znin4gzq4QCxZGbuLDl/7veQ 1bFoqJqsGnJZJUYQGo/vdg==; Received: from [87.69.77.57] (port=4287 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUR3U-0002hC-Gl; Sat, 03 Sep 2022 07:11:20 -0400 Date: Sat, 03 Sep 2022 14:10:50 +0300 Message-Id: <835yi4ogqt.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87edwsk9cb.fsf@posteo.net> (message from Philip Kaludercic on Sat, 03 Sep 2022 11:04:20 +0000) Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> <87edwsk9cb.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 57502@debbugs.gnu.org > From: Philip Kaludercic > Date: Sat, 03 Sep 2022 11:04:20 +0000 > > Are there any objections against applying this change? From what I see > pcase is used elsewhere in seq, so it should be possible to recognise > and expand the macro, right? I think we should avoid using pcase in subr.el, since subr.el is loaded by loadup.el before pcase. But I see that this ship has sailed already, sigh. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 07:20:08 2022 Received: (at 57502) by debbugs.gnu.org; 3 Sep 2022 11:20:08 +0000 Received: from localhost ([127.0.0.1]:41057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oURC4-0007re-8y for submit@debbugs.gnu.org; Sat, 03 Sep 2022 07:20:08 -0400 Received: from mout02.posteo.de ([185.67.36.66]:41047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oURC2-0007r5-3E for 57502@debbugs.gnu.org; Sat, 03 Sep 2022 07:20:06 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6C1B1240105 for <57502@debbugs.gnu.org>; Sat, 3 Sep 2022 13:19:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1662204000; bh=mzobjVQrju4fkcSjxZD7NJxezuCasTmbHPYqJ5yqhBc=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Sf8kN4Q79X+B6YfJLTu77fMPS0WMmwq9bADE4xby+1Vrwacotex0yU3JmaSQPwAF3 8gjHmfvOVqRdIAJqyQLy39uH9j13a4li/d5VvMvtKGMSrIv3mTOrO3zraS6KDG1gih 3mmp24klN58lET54RR9o2yOClJq4lu9HMbxh5+8n2rspg3jAto0NuMBIjwgD5Ky0hE EXGPuSf5Li5Jd3OthZEnfWLnQnmwH/Yu7mNbxYdYcg0nWeBWp77kn8zI7wu5aNNYtj JADyZVpaLCMSMJlHGeE+qJ9ep5+OcTo9OOy3OFUKlQLMoDIrqaQ7PkZy+9sMM7WYk5 nPu4UNBAvuJgw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MKXPT6FvHz9rxH; Sat, 3 Sep 2022 13:19:56 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <835yi4ogqt.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Sep 2022 14:10:50 +0300") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> <87edwsk9cb.fsf@posteo.net> <835yi4ogqt.fsf@gnu.org> 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 Date: Sat, 03 Sep 2022 11:19:55 +0000 Message-ID: <878rn0k8mc.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> Cc: 57502@debbugs.gnu.org >> From: Philip Kaludercic >> Date: Sat, 03 Sep 2022 11:04:20 +0000 >> >> Are there any objections against applying this change? From what I see >> pcase is used elsewhere in seq, so it should be possible to recognise >> and expand the macro, right? > > I think we should avoid using pcase in subr.el, since subr.el is > loaded by loadup.el before pcase. But I see that this ship has sailed > already, sigh. There is no insistence from my end to use pcase, especially because at first I assumed it ought not to be used in subr.el. But from what I see there have been instances of the macro (in `called-interactively-p') for almost ten years now. So unless there is a plan to revert this trend, I'd use pcase to avoid simple issues like the one that caused this bug. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 07:54:22 2022 Received: (at 57502) by debbugs.gnu.org; 3 Sep 2022 11:54:22 +0000 Received: from localhost ([127.0.0.1]:41081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oURjB-0002S8-It for submit@debbugs.gnu.org; Sat, 03 Sep 2022 07:54:22 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oURj9-0002Rw-SR for 57502@debbugs.gnu.org; Sat, 03 Sep 2022 07:54:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ff4yf0QgkO4a6FVjM+Kp0srhP4U6wnyxm2xOOj2bDyI=; b=sbHTp7kHOMFqiksjHyCFWNBnSu K490ncJ5j1UwRjM8LYAGzWoJ4Jf26g1+nWk4007KZGXjsNUSp9sC4kn1ysaRLS7Bl9yqPOM0V+p+Y L7l6atnh64O8DF+Y3t+BNU2NaJ61te7qlg+yjqcyXNdT/WOmfQT9Q9ex2STqC0JLpkmk=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oURj0-0007As-N4; Sat, 03 Sep 2022 13:54:13 +0200 From: Lars Ingebrigtsen To: Philip Kaludercic Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <878rn0k8mc.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 03 Sep 2022 11:19:55 +0000") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> <87edwsk9cb.fsf@posteo.net> <835yi4ogqt.fsf@gnu.org> <878rn0k8mc.fsf@posteo.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEX8+/3ez+DKt8q+ rcCZcImrlaPOpKmZYlxsVFNcQT65gntLNzWQVEkjHBv///8NCrBgAAAAAWJLR0QOb70wTwAAAAd0 SU1FB+YJAwszHYhUeagAAAGlSURBVDjLtZJBbtswEEWpnkDD5gIcQgeoFd3A3geRxiq6dFGdwArV oMsCoqALxDCyTO5QEF67C9/A0F06VJwgiOhFAvQDIqB58z81pIT4gCL15RNiPAUX88XlfH41BVIm 1yjjYFi4CgACIpjAyC9By/9W9G4AZ9ohDHhkfBfgQ5LnHHJ2xoE6DNQZgEplISARkQL1WKLWWeCK gA0ZTUHEQygGMAVaIwUBoqTFBMQeADvUm01iiHg8fAOiGOI4UqCTXCC8TjlplpBYvfyCY1mOj6ZS VM+36PsloORFzopCLPFEwE/M8mees2O58gk+6HPqpVFiklEjbioc95MqIVaesilJ6Ke4XVaICiC5 zoqRYMrfZDph6qqqVqiLvDTr0ZLnWdn2Ym8eqx/f07RZNNYYU1PG9KvdMrj99lClma27TdvY3z6O GnsvDnvuIyq6dus661pfrxu7ewIPVG6sO7qtszVRubbd4MGvvaHGdcMwuOOfdr4u265ncDDe1Lvt 4HW0pjXWOQ9Y+7+7YTeC4c5a2/PLEzj0w7Puus3G95zA/QtwLA/+Ade4tuiaz5XrAAAAJXRFWHRk YXRlOmNyZWF0ZQAyMDIyLTA5LTAzVDExOjUxOjI5KzAwOjAw3PY7fAAAACV0RVh0ZGF0ZTptb2Rp ZnkAMjAyMi0wOS0wM1QxMTo1MToyOSswMDowMK2rg8AAAAAASUVORK5CYII= X-Now-Playing: The Cure's _Seventeen Seconds (1)_: "Three" Date: Sat, 03 Sep 2022 13:54:08 +0200 Message-ID: <87ilm4hdwf.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philip Kaludercic writes: > So unless there is a plan to revert this trend, I'd use pcase to avoid > simple issues like the one that caused this bug. Looks good to me. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502 Cc: 57502@debbugs.gnu.org, Eli Zaretskii , arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > So unless there is a plan to revert this trend, I'd use pcase to avoid > simple issues like the one that caused this bug. Looks good to me. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 08:56:27 2022 Received: (at 57502-done) by debbugs.gnu.org; 3 Sep 2022 12:56:27 +0000 Received: from localhost ([127.0.0.1]:41163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUShH-0006Fz-DM for submit@debbugs.gnu.org; Sat, 03 Sep 2022 08:56:27 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUShE-0006Fj-AT for 57502-done@debbugs.gnu.org; Sat, 03 Sep 2022 08:56:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3CE11240027 for <57502-done@debbugs.gnu.org>; Sat, 3 Sep 2022 14:56:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1662209778; bh=l+o/IBq/Kuq32Bsok1Qxc/NmQA15ya5ppA7BbMLiSH0=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=G/N3PAhCnzG82HeZaUoT7/lWLSjsHM1Xl1csx+ZcSjeKmVfPZncZPb2cEioPYdY7h Yff0K0oMN0ern6zbo/xEc+SrP71NRcwbqhPbfpaEzYom2gNtBpcqDpDQIxmAYuGD+o u6JGSN+TDdRCNK/ne3fajOXMJAue9fgEhMq/t0rGEkCAFQ2UQqTwoxSYl/NQbZ9sBI KM12haWWnJs9k/KJdFfVnTM2cBVr5bDVJlnPDcn0MQm4DSn3sc1ABBvn11zunQFlQN k+yX4M4wduQLGi267QqKq48ACY102zRdi2DxjsAvso7MzSY1WcjR0Rl+VzXz0/ciNK w6mHljFYJLOTw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MKZXZ2bBQz9rxY; Sat, 3 Sep 2022 14:56:14 +0200 (CEST) From: Philip Kaludercic To: Lars Ingebrigtsen Subject: Re: bug#57502: 29.0.50; Issue with `or' clause of buffer-match-p In-Reply-To: <87ilm4hdwf.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 03 Sep 2022 13:54:08 +0200") References: <87o7w0fwnt.fsf@gmail.com> <87ilm87f78.fsf@posteo.net> <878rn47f21.fsf@posteo.net> <87edwsk9cb.fsf@posteo.net> <835yi4ogqt.fsf@gnu.org> <878rn0k8mc.fsf@posteo.net> <87ilm4hdwf.fsf@gnus.org> 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 Date: Sat, 03 Sep 2022 12:56:13 +0000 Message-ID: <874jxok45u.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57502-done Cc: 57502-done@debbugs.gnu.org, Eli Zaretskii , arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >> So unless there is a plan to revert this trend, I'd use pcase to avoid >> simple issues like the one that caused this bug. > > Looks good to me. Ok, I've pushed the change. From unknown Sun Aug 17 22:06:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Oct 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator