From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54296: Add buffer-matching functionality Date: Thu, 10 Mar 2022 13:53:54 +0200 Message-ID: <83bkyednvx.fsf@gnu.org> References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5049"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54296@debbugs.gnu.org, larsi@gnus.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 10 12:58:38 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 1nSHRF-000196-Ua for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Mar 2022 12:58:38 +0100 Original-Received: from localhost ([::1]:46276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSHRE-0005CB-QN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Mar 2022 06:58:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSHNm-00071D-6Q for bug-gnu-emacs@gnu.org; Thu, 10 Mar 2022 06:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSHNl-0003mm-SI for bug-gnu-emacs@gnu.org; Thu, 10 Mar 2022 06:55:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSHNl-0006fE-Qj for bug-gnu-emacs@gnu.org; Thu, 10 Mar 2022 06:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 11:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54296 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164691324825541 (code B ref 54296); Thu, 10 Mar 2022 11:55:01 +0000 Original-Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 11:54:08 +0000 Original-Received: from localhost ([127.0.0.1]:33497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSHMu-0006dt-1C for submit@debbugs.gnu.org; Thu, 10 Mar 2022 06:54:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSHMp-0006cv-AJ for 54296@debbugs.gnu.org; Thu, 10 Mar 2022 06:54:06 -0500 Original-Received: from [2001:470:142:3::e] (port=54590 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSHMj-0003gy-D1; Thu, 10 Mar 2022 06:53:57 -0500 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=TYgD/jRHMlfRLTT/wBdjCVU5zcQ+tbhJgobo4/Cht68=; b=lA1NCDts2nb2 T0acOZWAaYgJPUyIaeDk1bMCXpox12tPpbrjhX6zxuk+lgMvHFZyMwagT8xXYK9+sg1QzP4p2vCuH 9Yks6f36twuPop8tIGsFcXgSUOFQedO79QJFr7VHvmjsd+v44lgyaBlrBZXkooRu2mWnrK0mrDsWT XRB3tZBtMbroHV+Zxie6taMdqOoh20A1JD76UxqPld+35GjAnGeK1jIL0H7xzmtkLPyCLQ5oNv+l4 YK3E2tZ4CVzqOqtzGZf6V6PfkAoj73IH0P1MXzwS3+SIry0FLx6+TVI2Hm/lO4s8HPWis/SFDNT+H TRoh8GsS0tSOBS8mO9TCOQ==; Original-Received: from [87.69.77.57] (port=4991 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 1nSHMi-0005xV-NR; Thu, 10 Mar 2022 06:53:57 -0500 In-Reply-To: <877d92unqn.fsf@posteo.net> (message from Philip Kaludercic on Thu, 10 Mar 2022 10:05:04 +0000) 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:228185 Archived-At: > From: Philip Kaludercic > Date: Thu, 10 Mar 2022 10:05:04 +0000 > Cc: 54296@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.