GNU bug report logs - #54296
Add buffer-matching functionality

Previous Next

Package: emacs;

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

Date: Mon, 7 Mar 2022 22:34:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 54296 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#54296: Add buffer-matching functionality
Date: Thu, 10 Mar 2022 13:53:54 +0200
> From: Philip Kaludercic <philipk <at> posteo.net>
> Date: Thu, 10 Mar 2022 10:05:04 +0000
> Cc: 54296 <at> debbugs.gnu.org
> 
> +(defun buffer-match (condition buffer-or-name &optional arg)
> +  "Return non-nil if BUFFER-OR-NAME matches CONDITION.

This is a predicate function, so its name should be buffer-matches-p
or maybe buffer-matches-condition-p.

> +CONDITION is is either:
             ^^^^^
Typo.

> +- a regular expression, to match a buffer name,
> +- a predicate function that takes a buffer object and ARG as
> +  arguments and returns non-nil if the buffer matches,
              ^
Comma missing there.

> +- a cons-cell, where the car describes how to interpret the cdr.
> +  The car can be one of the following:
> +  * `major-mode': the buffer matches if the buffer's major
> +    mode is eq to the cons-cell's cdr
> +  * `derived-mode': the buffer matches if the buffer's major
> +    mode is derived from the major mode denoted by the cons-cell's
> +    cdr

Do we really need both major-mode and derived-mode?

> +  * `not': the cdr is interpreted as a negation of a condition.
> +  * `and': the cdr is a list of recursive condition, that all have
> +    to be met.                            ^^^^^^^^^

Typo: should be "conditions".

> +  * `or': the cdr is a list of recursive condition, of which at
> +    least one has to be met."            ^^^^^^^^^

Likewise.

Thanks.




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

Previous Next


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