GNU bug report logs - #58951
[PATCH] ; Fix handling of 'not' by 'buffer-match-p'

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Tue, 1 Nov 2022 19:37:02 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 58951 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: help-debbugs <at> gnu.org (GNU bug Tracking System)
Cc: 58951 <at> debbugs.gnu.org
Subject: Re: bug#58951: Acknowledgement ([PATCH] ; Fix handling of 'not' by
 'buffer-match-p')
Date: Tue, 01 Nov 2022 20:19:06 +0000
[Message part 1 (text/plain, inline)]
I forgot to update the documentation in buffers.texi:

[0001-Fix-handling-of-not-by-buffer-match-p.patch (text/x-patch, inline)]
From 279f9561dd115d707b086efdbc19072fceb7a99f Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk <at> posteo.net>
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


This bug report was last modified 2 years and 140 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.