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#58951: Acknowledgement ([PATCH] ; Fix handling of 'not' by 'buffer-match-p') Date: Tue, 01 Nov 2022 20:19:06 +0000 Message-ID: <87pme6cts5.fsf__13109.1773788043$1667334030$gmane$org@posteo.net> References: <871qqmeac3.fsf@posteo.net> 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="38087"; mail-complaints-to="usenet@ciao.gmane.io" To: 58951@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 01 21:20:22 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 1opxkD-0009hF-L0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Nov 2022 21:20:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opxjw-0008EQ-RU; Tue, 01 Nov 2022 16:20:04 -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 1opxjv-0008EI-2g for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 16:20: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 1opxju-0008JW-RY for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 16:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opxju-0000Jk-28 for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 16:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2022 20:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: help-debbugs@gnu.org (GNU bug Tracking System) X-Debbugs-Original-Cc: 58951@debbugs.gnu.org Original-Received: via spool by 58951-submit@debbugs.gnu.org id=B58951.16673339591158 (code B ref 58951); Tue, 01 Nov 2022 20:20:02 +0000 Original-Received: (at 58951) by debbugs.gnu.org; 1 Nov 2022 20:19:19 +0000 Original-Received: from localhost ([127.0.0.1]:44291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opxjC-0000Ia-PC for submit@debbugs.gnu.org; Tue, 01 Nov 2022 16:19:19 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:47359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opxj9-0000IL-CL for 58951@debbugs.gnu.org; Tue, 01 Nov 2022 16:19:15 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 75F75240104 for <58951@debbugs.gnu.org>; Tue, 1 Nov 2022 21:19:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667333949; bh=ZFuNV6PwDkOCyTxFhKWxdiRgugWB9S4s+TBhpRVLqXo=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=bNv4JLBCRskPGvKPRg5huR6uma6Za+j6XEo4WQZNeatZ0nEz+rVlK3tqWV/qCw1pi Tv8GvstGdgRWRpyV8CaSh+4upEG/9O4U9uCpaS5aEJqPGGqrVXQwTmAgl+EpD6FZMK /CFMfzW9kCFyDQ1VaHlbdFpEYnEIKzhu9Js8Vk1nDut7w2+afYA3zkIeJU+9MklCR1 9rw22qE11lTYQ8DrwUA3ztG4VtfKeVpWCgdsTRXEaisv4oZYjrSmJ+nDC2ustHf2qZ 3I1A3N0CQsEg5teIQ8hBaRLt+oUPi0T2Hd1kPoJxQw4JixLhZZAH/RVZTRgyJ9hTn3 x8giU72FWt9QQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N21ZM70wFz6tn3; Tue, 1 Nov 2022 21:19:07 +0100 (CET) In-Reply-To: (GNU bug Tracking System's message of "Tue, 01 Nov 2022 19:37:02 +0000") 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246808 Archived-At: --=-=-= Content-Type: text/plain I forgot to update the documentation in buffers.texi: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-handling-of-not-by-buffer-match-p.patch >From 279f9561dd115d707b086efdbc19072fceb7a99f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 1 Nov 2022 20:27:17 +0100 Subject: [PATCH] ; Fix handling of 'not' by 'buffer-match-p' * lisp/subr.el (buffer-match-p): Look up the cadr instead of the cdr for the negation in 'not'. * doc/lispref/buffers.texi (Buffer List): Update documentation. --- doc/lispref/buffers.texi | 18 ++++++++---------- lisp/subr.el | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index c40e088293..8405e28387 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -977,17 +977,15 @@ Buffer List A cons-cell @code{(@var{oper} . @var{expr})} where @var{oper} is one of @table @code -@item not -Satisfied if @var{expr} doesn't satisfy @code{buffer-match-p} with +@item (not @var{cond}) +Satisfied if @var{cond} doesn't satisfy @code{buffer-match-p} with the same buffer and @code{arg}. -@item or -Satisfied if @var{expr} is a list and @emph{any} condition in -@var{expr} satisfies @code{buffer-match-p}, with the same buffer and -@code{arg}. -@item and -Satisfied if @var{expr} is a list and @emph{all} conditions in -@var{expr} satisfy @code{buffer-match-p}, with the same buffer and -@code{arg}. +@item (or @var{conds}@dots{}) +Satisfied if and @emph{any} condition in @var{conds} satisfies +@code{buffer-match-p}, with the same buffer and @code{arg}. +@item (and @var{conds}@dots{}) +Satisfied if @emph{all} conditions in @var{conds} satisfy +@code{buffer-match-p}, with the same buffer and @code{arg}. @item derived-mode Satisfied if the buffer's major mode derives from @var{expr}. @item major-mode diff --git a/lisp/subr.el b/lisp/subr.el index b667339db9..0252e66686 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -7023,7 +7023,7 @@ string-lines `(provided-mode-derived-p (buffer-local-value 'major-mode ,buffer-sym) ',mode)) - (`(not . ,cond) + (`(not ,cond) `(not ,(funcall translate cond))) (`(or . ,conds) `(or ,@(mapcar translate conds))) @@ -7045,7 +7045,7 @@ string-lines * `major-mode': the buffer matches if the buffer's major mode is eq to the cons-cell's cdr. Prefer using `derived-mode' instead when both can work. - * `not': the cdr is interpreted as a negation of a condition. + * `not': the cadr is interpreted as a negation of a condition. * `and': the cdr is a list of recursive conditions, that all have to be met. * `or': the cdr is a list of recursive condition, of which at -- 2.38.0 --=-=-=--