From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Mar 2022 22:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54296 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 54296@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164669242225970 (code B ref -1); Mon, 07 Mar 2022 22:34:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2022 22:33:42 +0000 Received: from localhost ([127.0.0.1]:54806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRLvC-0006ko-3Q for submit@debbugs.gnu.org; Mon, 07 Mar 2022 17:33:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:33776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRLvA-0006kf-FE for submit@debbugs.gnu.org; Mon, 07 Mar 2022 17:33:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRLvA-0002O8-2c for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 17:33:40 -0500 Received: from mout02.posteo.de ([185.67.36.66]:49891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRLv7-0003jO-FP for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 17:33:39 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8441C240103 for ; Mon, 7 Mar 2022 23:33:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1646692415; bh=6Ok2SGWJi4yNthyZSGYC4kbdoXJ/ksCA1pEwBc54f50=; h=From:To:Subject:Autocrypt:Date:From; b=VchmMhKyx/lF2uIwGs85rb75anZIKclXNcj3RXwG8LJdEvOeIho/mdnFVSN9vxbhv iIXANPMtbFljRYLrQgEwHXcvwzjrjC9vvANfqS/qqcogukm1I9vFDkH0eSSDSlpsvn /oByMMYEv1asmIb76hRcAWZSdfcXisv3VIr7VuUkoo3jmRTd0q5jgAnpl7CqecFnzD znijSbRuFoih8B8T30vfP0NnvBKJtSqclanHIa1OGDw211PY/xvLRB8oWzZkxgF6X+ H75jxbyRlRj7PrijtXfQGtLgaPP1z3azG6l2aWQOUJhEtnHCw2SJB5V96YoOi62KdC 8SU5I15MGwg1Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KCCsp74vQz9rxD for ; Mon, 7 Mar 2022 23:33:34 +0100 (CET) From: Philip Kaludercic 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: Mon, 07 Mar 2022 22:33:29 +0000 Message-ID: <87ee3d4cli.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-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 (--) --=-=-= Content-Type: text/plain Tags: patch Project.el currently has a small language for matching buffers, used by project-kill-buffers and project--read-project-buffer. As mentioned in [0], this could be generalised, as done in the patch below. As to what file this should be added to, should be discussed. Either way I would consider these functions useful and would have wanted to use them in my own code many times before. While difficult, it might also be useful for things like display-buffer-alist (the issue is that a function as a condition in display-buffer-alist has to accept two arguments, while the proposed patch only takes one). To match functions such as string-match, the argument of buffer-match could be reversed so that the function can be used as a testfn to assoc/alist-get. The reason this was not immediately done when project-kill-buffers was implemented, was that this would raise the "emacs" dependency of the ELPA package "project" to the latest release or even the current development version. To solve issues like these, I have been working on "compat", a yet-unreleased library added to GNU ELPA a while back that could be added as a dependency to project. That way newer functions, such as the ones propose below could be used, without breaking ELPA compatibility. To make this work properly in the near future, compat would have to follow the upstream development, before a release is made. If there is any interest in this kind of an arrangement, I could start a thread on emacs-devel to discuss the details. [0] https://mail.gnu.org/archive/html/emacs-devel/2020-09/msg00082.html [1] https://elpa.gnu.org/devel/compat.html In GNU Emacs 29.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-02-24 built on viero Repository revision: bd17fa2c7565f180cedbfa396c0b159e144178cb Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Generalise-buffer-matching-from-project.el.patch >From f268509ba1b617b65851231c5ae262f3b169cd6c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 7 Mar 2022 20:49:42 +0100 Subject: [PATCH] Generalise buffer matching from project.el * subr.el (buffer-match): Add function to check if a buffer satisfies a condition. (match-buffers): Returns all buffers that satisfy a condition. --- lisp/subr.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index eb9af0b36d..1d0c9cf967 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6613,4 +6613,63 @@ delete-line (forward-line 1) (point)))) +(defun buffer-match (buffer condition) + "Return non-nil if BUFFER matches CONDITION. +CONDITION is is either: +- a regular expression, to match a buffer name, +- a predicate function that takes a buffer object as argument + and returns non-nil if the buffer should be killed, +- a cons-cell, where the car describes how to interpret the cdr. + The car can be one of the following: + * `major-mode': the buffer is killed if the buffer's major + mode is eq to the cons-cell's cdr + * `derived-mode': the buffer is killed if the buffer's major + mode is derived from the major mode denoted by the cons-cell's + cdr + * `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. + * `or': the cdr is a list of recursive condition, of which at + least one has to be met." + (letrec + ((match + (lambda (conditions) + (catch 'match + (dolist (condition conditions) + (when (cond + ((stringp condition) + (string-match-p condition (buffer-name buffer))) + ((symbolp condition) + (funcall condition buffer)) + ((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 conditions) + (unless (funcall match c) + (throw 'fail nil))) + t))) + (throw 'match t))))))) + (funcall match (list condition)))) + +(defun match-buffers (condition &optional buffers) + "Return a list of buffers that match CONDITION. +See `buffer-match' for details on CONDITION. By default all +buffers are checked, this can be restricted by passing an +optional argument BUFFERS, set to a list of buffers to check." + (let (bufs) + (dolist (buf (or buffers (buffer-list))) + (when (buffer-match buf condition) + (push buf bufs))) + bufs)) + ;;; subr.el ends here -- 2.34.0 --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=-- From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Mar 2022 16:21:02 +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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, martin rudalics Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164684285829788 (code B ref 54296); Wed, 09 Mar 2022 16:21:02 +0000 Received: (at 54296) by debbugs.gnu.org; 9 Mar 2022 16:20:58 +0000 Received: from localhost ([127.0.0.1]:60535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRz3a-0007kN-7K for submit@debbugs.gnu.org; Wed, 09 Mar 2022 11:20:58 -0500 Received: from quimby.gnus.org ([95.216.78.240]:48190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRz3X-0007k7-9d for 54296@debbugs.gnu.org; Wed, 09 Mar 2022 11:20:56 -0500 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:In-Reply-To:Date: References: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=JMmN8xW4cHDdb9R8gHD4KYInSgbctPKS3HDh1mRFk5A=; b=EoiHeWVg5hnlF+JZsKn0MQ5R1O SPPACaBqeCyDhlXodDgNxeonDlSIce4H8+oYhfh/eHpVIiHgE2fYtVhLpBlkWyb6LrDaiislIhPMj L8dmYtcELX20bhEviySREJikNq+CWqDxVJJYQfrDZplqoRwa/4Kfb3FakusNdPkmH89I=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRz3O-0000jr-1C; Wed, 09 Mar 2022 17:20:48 +0100 From: Lars Ingebrigtsen References: <87ee3d4cli.fsf@posteo.net> X-Now-Playing: Scritti Politti's _Songs to Remember_: "Faithless" Date: Wed, 09 Mar 2022 17:20:45 +0100 In-Reply-To: <87ee3d4cli.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 07 Mar 2022 22:33:29 +0000") Message-ID: <87k0d35c82.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: > Either way I would consider these functions useful and would have wanted > to use them in my own code many times before. While difficult, it might > also be useful for things like display-buffer-ali [...] 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-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: > Either way I would consider these functions useful and would have wanted > to use them in my own code many times before. While difficult, it might > also be useful for things like display-buffer-alist (the issue is that > a function as a condition in display-buffer-alist has to accept two > arguments, while the proposed patch only takes one). Hm... how would this be used with display-buffer-alist, then? (And perhaps Martin has some comments; added to the CCs.) > To match functions such as string-match, the argument of buffer-match > could be reversed so that the function can be used as a testfn to > assoc/alist-get. I think I'd prefer to have the parameters reversed -- the condition is a kind of predicate, and these days we seem to prefer to have the predicate first. > +(defun buffer-match (buffer condition) > + "Return non-nil if BUFFER matches CONDITION. > +CONDITION is is either: > +- a regular expression, to match a buffer name, > +- a predicate function that takes a buffer object as argument > + and returns non-nil if the buffer should be killed, Killed? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Mar 2022 20:35: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 To: Lars Ingebrigtsen , Philip Kaludercic Cc: 54296@debbugs.gnu.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164685806932246 (code B ref 54296); Wed, 09 Mar 2022 20:35:01 +0000 Received: (at 54296) by debbugs.gnu.org; 9 Mar 2022 20:34:29 +0000 Received: from localhost ([127.0.0.1]:60857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nS30v-0008O1-0R for submit@debbugs.gnu.org; Wed, 09 Mar 2022 15:34:29 -0500 Received: from mout.gmx.net ([212.227.15.19]:52259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nS30t-0008Nn-Ki for 54296@debbugs.gnu.org; Wed, 09 Mar 2022 15:34:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646858061; bh=7nzVDQ6sSK7NTZobXp/TwaSe+E224pXAJgZlqvB4EKM=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=hPiHQpmd+czDCjI1VhOc8Ljl8xWXQurX6QPcnIWVem6N/Ru/8o4Pr0Ea46DUmBfZN +FrAYWcHU3v5IsRlsOiHr1tL40Z4vzuNuMc+bRZelk5mjceo1g4zSxw0JULf54Zvl/ pSXx/XZ04b/qTOVssagKTiitqjKVFoaCNhm814i0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.103] ([213.142.96.95]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MA7GS-1nHcco3vp4-00Bcpq; Wed, 09 Mar 2022 21:34:21 +0100 Message-ID: Date: Wed, 9 Mar 2022 21:34:19 +0100 MIME-Version: 1.0 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> From: martin rudalics In-Reply-To: <87k0d35c82.fsf@gnus.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:qpf4stlllribQDcqWbEfiSjxdpCILVfI0TE7Xs1yoXvmOGMUH1C +nM/e5QDqMFYQrN9IT7ulJLDT3J04jsAhnHCfHPLvKVVzjpXve+S9FfxJs0fIFpLSNCo/zg m4G3TCpc3pfftGVx0PsOVCt84v5raRPpRSf539azXlZMHDNBlxH20t4fJNK7DrZFNdjdbzk TGEHuKFrBW5k4G6e6HTQg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:q/9Qic/zWC4=:msO89kc3nSGVDNWNA5+U08 w8GB/yh/zrevSTZ3HTMT5v5NgfaBv88My35Soi0ungjsslFARBpL0BhGO3YeMFnmvl1ng+/X6 UqYlApgauTFJDopTaB194NG1QSr0i6AD4oT4X8VDBOgsadNP8DFfWaUyPQWbqMf+LUotwZ37A gnQKst87MArlOG6RiSewBIZj43XNOia6GXm0t4qquT41OOH4I94fmFREqd/0ygonmADq5KF9a T0+sJfdKnl07IzDrVa98M2Ggq1cxA+D2Z6Y1a5QWvCvoHRhpe4560mrA5QRRTN2kY5c9O69g+ z5t9/sPv5m7w90D7vDOlvqzPQ4LS2xm1lqBefnimZxxC/KzNOzepPc0Bkx9nwTbp1FuUs/146 heswx59oMiaw32PEO7SNNI/+O7ne7uZjpQq4NZVjGM1s55/+Ku6P5j6DwUdDDfUiVU3xR2AIk 9L659tNOML0AnbO5KVsov1Gr8B17yUmVT6IjcuklBUci6aYQp4SE7z0E+qxcnnGaRT13GTpNn Hx6n2jaNMAWb2ScdJbhw/7gR2izAddrGuBefFzSjvgNlioHGxxvDicvA7Cni9jExV2wfesoue hYK3dqvia3pHg4/jQx14d3M8sTCmWaijKBH0OlB5vWJIt2Fi/k49LndtRpRhPLDRZ/+S3Xjzu 3srESZMR0xOJBbmMmI1m76LMnearv6EmdR1PJhCpDX8tKZmvTFmSrPmhy4KeIJ4kPJZGzthlZ V/7d1+WMssyn2LoTjHGVl7MVrvfEZsm8Ay8YU1aRBtZd/s6iUar7zW0j9NLutvl+VWgenfdjl ggOh9cy7Kvq2G6sCMRT24nDpL+soBrgWvydnDrYuBbm+D0h6kQXeRPEDtW4ODo/ODm50C3sRc ip1sJ+RRtFkCW/5/9tgLUY+2a6U8KBq54Funz7EwIaXXrvVNV/c4WV8om7Of7D3okxenZav8x orncyP63IFfrM91vNKxFsraqeHddVHQOWT/CgyI21olWjzMkrOGjwtNGgTasrAfwUpSCPOtyx zfpKtfhc0FpKqwV843oj9OIDDSs+k5Pvt9ExYGd0nxGpPc7x5zY3KkEBoloIu0eqCLj7ufk7c SpCnnLAS3hF5Bg= X-Spam-Score: -0.7 (/) 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.7 (-) >> Either way I would consider these functions useful and would have wanted >> to use them in my own code many times before. While difficult, it might >> also be useful for things like display-buffer-alist (the issue is that >> a function as a condition in display-buffer-alist has to accept two >> arguments, while the proposed patch only takes one). > > Hm... how would this be used with display-buffer-alist, then? (And > perhaps Martin has some comments; added to the CCs.) Either add an optional second argument to 'buffer-match' or add to 'display-buffer-alist' an entry that uses a function as condition that calls 'buffer-match' with the first argument and returns non-nil if 'buffer-match' reports a match. I see no issue here. martin From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 10:06: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 To: Lars Ingebrigtsen Cc: 54296@debbugs.gnu.org, martin rudalics Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164690671513239 (code B ref 54296); Thu, 10 Mar 2022 10:06:01 +0000 Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 10:05:15 +0000 Received: from localhost ([127.0.0.1]:33276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSFfW-0003RS-LP for submit@debbugs.gnu.org; Thu, 10 Mar 2022 05:05:15 -0500 Received: from mout02.posteo.de ([185.67.36.66]:47049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSFfU-0003R9-A1 for 54296@debbugs.gnu.org; Thu, 10 Mar 2022 05:05:13 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 400B3240103 for <54296@debbugs.gnu.org>; Thu, 10 Mar 2022 11:05:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1646906706; bh=TZdf7yYcP+NLFQQcDOrAXRbJBteFd1YaVJ62Z9kupDE=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=hr99hmDdSg9z13wDKnodnBsnJbcjEsuXL2gsvfn6rsZwkbkDxRLGoMKcMSKjmZSqW nYFSTVfbv2PWKIVn7OBi1MVx2/32kC0kFRrSaP685WUwaASJk7Lh4WSBlDnlFTvRSm BD2EowZ0OMC2TKxHKUKSX1+tGx8iW8OY+8Dkx+geICecZQ18/duBx7vLLSuo7qmre6 QxnpzQtfxwS90Fxk/4AIzTqfYhbESVNuZ/qOPD1IGfXaUBX7bk/TldCnCVfejf9pNi gzWAjzNFPyL3KiW4C+nzGIWgYLFyzedOakOiqN7xIK0Yv1AP5GcoJSFystHowTzwdM BKM4FNHv3KDVA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KDl6m6g7Lz6tm9; Thu, 10 Mar 2022 11:05:04 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.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: Thu, 10 Mar 2022 10:05:04 +0000 In-Reply-To: <87k0d35c82.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 09 Mar 2022 17:20:45 +0100") Message-ID: <877d92unqn.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) 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 Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >> Either way I would consider these functions useful and would have wanted >> to use them in my own code many times before. While difficult, it might >> also be useful for things like display-buffer-alist (the issue is that >> a function as a condition in display-buffer-alist has to accept two >> arguments, while the proposed patch only takes one). > > Hm... how would this be used with display-buffer-alist, then? (And > perhaps Martin has some comments; added to the CCs.) See below. >> To match functions such as string-match, the argument of buffer-match >> could be reversed so that the function can be used as a testfn to >> assoc/alist-get. > > I think I'd prefer to have the parameters reversed -- the condition is a > kind of predicate, and these days we seem to prefer to have the > predicate first. I agree, it makes more sense. >> +(defun buffer-match (buffer condition) >> + "Return non-nil if BUFFER matches CONDITION. >> +CONDITION is is either: >> +- a regular expression, to match a buffer name, >> +- a predicate function that takes a buffer object as argument >> + and returns non-nil if the buffer should be killed, > > Killed? That was a typo from copying the docstring. Here is the updated patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Generalise-buffer-matching-from-project.el.patch >From 6714a4dc7168e6806dba0707c9c0b80d3365b2c5 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 7 Mar 2022 20:49:42 +0100 Subject: [PATCH 1/2] Generalise buffer matching from project.el * subr.el (buffer-match): Add function to check if a buffer satisfies a condition. (match-buffers): Returns all buffers that satisfy a condition. --- lisp/subr.el | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 2321765f95..adcd25ec14 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6613,4 +6613,68 @@ delete-line (forward-line 1) (point)))) +(defun buffer-match (condition buffer-or-name &optional arg) + "Return non-nil if BUFFER-OR-NAME matches CONDITION. +CONDITION is is either: +- 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, +- 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 + * `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. + * `or': the cdr is a list of recursive condition, of which at + least one has to be met." + (letrec + ((buffer (get-buffer buffer-or-name)) + (match + (lambda (conditions) + (catch 'match + (dolist (condition conditions) + (when (cond + ((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 conditions) + (unless (funcall match c) + (throw 'fail nil))) + t))) + (throw 'match t))))))) + (funcall match (list condition)))) + +(defun match-buffers (condition &optional buffers arg) + "Return a list of buffers that match CONDITION. +See `buffer-match' for details on CONDITION. By default all +buffers are checked, this can be restricted by passing an +optional argument BUFFERS, set to a list of buffers to check. +ARG is passed to `buffer-match', for predicate conditions in +CONDITION." + (let (bufs) + (dolist (buf (or buffers (buffer-list))) + (when (buffer-match condition (get-buffer buf) arg) + (push buf bufs))) + bufs)) + ;;; subr.el ends here -- 2.34.0 --=-=-= Content-Type: text/plain martin rudalics writes: >>> Either way I would consider these functions useful and would have >>> wanted >>> to use them in my own code many times before. While difficult, it >>> might >>> also be useful for things like display-buffer-alist (the issue is that >>> a function as a condition in display-buffer-alist has to accept two >>> arguments, while the proposed patch only takes one). >> >> Hm... how would this be used with display-buffer-alist, then? (And >> perhaps Martin has some comments; added to the CCs.) > > Either add an optional second argument to 'buffer-match' or add to > 'display-buffer-alist' an entry that uses a function as condition that > calls 'buffer-match' with the first argument and returns non-nil if > 'buffer-match' reports a match. I see no issue here. This seems to work, and updating window.el was also pretty trivial (unless I have missed something): --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-window.el-display-buffer-assq-regexp-Use-buffer-matc.patch >From fadea32d0dc74952ca70f8d98ced59616c0e3e1a Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 10 Mar 2022 10:59:52 +0100 Subject: [PATCH 2/2] * window.el (display-buffer-assq-regexp): Use buffer-match --- lisp/window.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 54c9eee5f3..4225019920 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7497,19 +7497,12 @@ display-buffer-fallback-action (defun display-buffer-assq-regexp (buffer-name alist action) "Retrieve ALIST entry corresponding to BUFFER-NAME. This returns the cdr of the alist entry ALIST if either its key -is a string that matches BUFFER-NAME, as reported by -`string-match-p'; or if the key is a function that returns -non-nil when called with three arguments: the ALIST key, -BUFFER-NAME and ACTION. ACTION should have the form of the -action argument passed to `display-buffer'." +satisfied a BUFFER-NAME per `buffer-match'. ACTION should have +the form of the action argument passed to `display-buffer'." (catch 'match (dolist (entry alist) - (let ((key (car entry))) - (when (or (and (stringp key) - (string-match-p key buffer-name)) - (and (functionp key) - (funcall key buffer-name action))) - (throw 'match (cdr entry))))))) + (when (buffer-match (car entry) buffer-name action) + (throw 'match (cdr entry)))))) (defvar display-buffer--same-window-action '(display-buffer-same-window -- 2.34.0 --=-=-= Content-Type: text/plain > martin > -- Philip Kaludercic --=-=-=-- From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality 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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164691324825541 (code B ref 54296); Thu, 10 Mar 2022 11:55:01 +0000 Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 11:54:08 +0000 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 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 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==; 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 Date: Thu, 10 Mar 2022 13:53:54 +0200 Message-Id: <83bkyednvx.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877d92unqn.fsf@posteo.net> (message from Philip Kaludercic on Thu, 10 Mar 2022 10:05:04 +0000) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) > 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. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 12:15:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164691445027597 (code B ref 54296); Thu, 10 Mar 2022 12:15:02 +0000 Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 12:14:10 +0000 Received: from localhost ([127.0.0.1]:33521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSHgH-0007B3-QP for submit@debbugs.gnu.org; Thu, 10 Mar 2022 07:14:10 -0500 Received: from mout01.posteo.de ([185.67.36.65]:52225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSHgG-0007Ao-BT for 54296@debbugs.gnu.org; Thu, 10 Mar 2022 07:14:09 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6E538240026 for <54296@debbugs.gnu.org>; Thu, 10 Mar 2022 13:14:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1646914442; bh=x9qvuxxqlIDjQ8IqvM8XXHjAnlZUszMF8Dibe/WFzj4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=HpfA766Q9pDzDvY/BDiA8z7AvCQBBRFgHVp633BuN1vu8lWGRQCFh4CZUXxnbHcnI 9VCviJfZ7jIp+A0qNITX0pOBbOGicOTOl6D33XaQQB/K1Fn3LUnSH9uiU5y7eSqknl 6S/lkt5MaIwDS6i3BZMH1RodazHhTcKZfHLAXyifPlXel/8MnKD6wuYvq6zUFUPjuV BGLFCyyubGOorC3KVROMxm6dK+A4ktz8tw20ddw4Mt9RXi/fEAwx2fFawEPrD6mEro k/2J+mRdg2cKp0Hsy/K4TBBuzuDPokrspGPuF008mNopKfzMoup5Iilo5QMve/OsQv kVBRls+x7Qqxg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KDnzY22V6z6tpj; Thu, 10 Mar 2022 13:14:00 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.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: Thu, 10 Mar 2022 12:13:59 +0000 In-Reply-To: <83bkyednvx.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 10 Mar 2022 13:53:54 +0200") Message-ID: <87cziudmyg.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) 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 Eli Zaretskii writes: >> 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. I like buffer-matches-p. >> +CONDITION is is either: > ^^^^^ > Typo. Sorry about those, it and the other ones here: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Generalise-buffer-matching-from-project.el.patch >From 8dfcabb8c655f06c8c7285c6da7efad7057b636e Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 7 Mar 2022 20:49:42 +0100 Subject: [PATCH 1/2] Generalise buffer matching from project.el * subr.el (buffer-match): Add function to check if a buffer satisfies a condition. (match-buffers): Returns all buffers that satisfy a condition. --- lisp/subr.el | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 2321765f95..e55a4c5802 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6613,4 +6613,68 @@ delete-line (forward-line 1) (point)))) +(defun buffer-match-p (condition buffer-or-name &optional arg) + "Return non-nil if BUFFER-OR-NAME matches CONDITION. +CONDITION is either: +- 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, +- 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 + * `not': the cdr 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 + least one has to be met." + (letrec + ((buffer (get-buffer buffer-or-name)) + (match + (lambda (conditions) + (catch 'match + (dolist (condition conditions) + (when (cond + ((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 conditions) + (unless (funcall match c) + (throw 'fail nil))) + t))) + (throw 'match t))))))) + (funcall match (list condition)))) + +(defun match-buffers (condition &optional buffers arg) + "Return a list of buffers that match CONDITION. +See `buffer-match' for details on CONDITION. By default all +buffers are checked, this can be restricted by passing an +optional argument BUFFERS, set to a list of buffers to check. +ARG is passed to `buffer-match', for predicate conditions in +CONDITION." + (let (bufs) + (dolist (buf (or buffers (buffer-list))) + (when (buffer-match-p condition (get-buffer buf) arg) + (push buf bufs))) + bufs)) + ;;; subr.el ends here -- 2.34.0 --=-=-= Content-Type: text/plain >> +- 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? It seems to have been useful in project.el, see `project-kill-buffer-conditions'. In that case you want to both be able to say something like "kill buffers only if they are in fundamental-mode", but also something like "kill all buffers that are based on comint-mode". -- Philip Kaludercic --=-=-=-- From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: [External] : bug#54296: Add buffer-matching functionality Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 14:53:02 +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 To: Philip Kaludercic , Eli Zaretskii Cc: "54296@debbugs.gnu.org" <54296@debbugs.gnu.org>, "larsi@gnus.org" Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164692397919859 (code B ref 54296); Thu, 10 Mar 2022 14:53:02 +0000 Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 14:52:59 +0000 Received: from localhost ([127.0.0.1]:33646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSK9z-0005AF-HM for submit@debbugs.gnu.org; Thu, 10 Mar 2022 09:52:59 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:62758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSK9v-0005A1-58 for 54296@debbugs.gnu.org; Thu, 10 Mar 2022 09:52:58 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22ADe0U6028062; Thu, 10 Mar 2022 14:52:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=5pfePcujnSGBvH1CA7tqGYPcLYm7mkCJOGuU45qU0J4=; b=E59VY4hMNGE3QUNUEQAmpPgGxN5oExwZXemUuUPZtbHVeilPXNWNRAHXro5EEfw+qPNZ 9+JsN8gAZEQnRtW+0hV4pz+z0hvqW+f051I/DDr6/Bfh3c7Ui4vG+vjxZ6Hjd+hIhhNx 4IlEXm3CyvCxFNFC32lHwK1mQi49LlJp5GgzTcjBWRjR+CdVf5EG0EauprCwGPswzAfN q1ZDzv5GcBDiQOvVZa9LMZytdh9yVioDzT77PWCAafc/3525itz9cSaa2ZJWwJHgnl50 nWdmjpDogrXzzvycfACjfTVLD2q+2PX5gGTpFbdEGkT38jJukfK8IuCK8D0TCDbRnjxE og== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3ekx9cna5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Mar 2022 14:52:50 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22AEkOo0059846; Thu, 10 Mar 2022 14:52:49 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2172.outbound.protection.outlook.com [104.47.55.172]) by userp3020.oracle.com with ESMTP id 3envvnahnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Mar 2022 14:52:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n96U79Z7ymkTMTe4Tn7qrIvLOYoEM6YNLxFrEmMRWPnB1369/sekRLjyzRS2FKRgTyhSLjxs4WnUMNYsB3sL0TddhAGQLSf6DiLBvAFzJPiDy7I4NFRR577MGxj7EN6y78DmXgQ0EwUcYT6JJNDhKnX1ox/Unb/YQRImjXJYIU/26ratCxqeER/MVZimfdOaqcc0pxG2homx9xw2bhD5/EiRdVM+it7c9mITzJ+OBO2xSrKAhh9VupJ2tGm71NLVbxx5XZEEv2nDVQUXUa6mp7K3R1JUpTpt8XtgbvPUpUtWmH1LdVgK3Ik/heGIg1d2GPuXfsJqHH9ifp3VwRS6kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5pfePcujnSGBvH1CA7tqGYPcLYm7mkCJOGuU45qU0J4=; b=d+rwkrQSeZZb0C6PEl4xCtlYzNJae2hYXtsUDgaut16V1kkK5UNfkQB3E/eOlGfnP9hqUkkhrt03uxG2tcIPmUHfoagD14RBvM8uqK6ot/1QpEi9/NFnPMeYDB/xk68Cu1REi15TAy/f6FdlF6YnRkCM4qDWr6tnSNic8QTzwA/b8PUaLsA/vQO+VRvPJyiv17pxidVVSPr8PlppEMmxJyoZoCL6YgC5Zi85+6vN6RgsfHNiYMvLsocncJG26e2k5EAHJopuytCcuZJzax4hs83t3B+t4VnCineR8f+ZKsordpxId7zsZG+b+GDVOxFOl1KUSaXOLXZpEHfHCT1qgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5pfePcujnSGBvH1CA7tqGYPcLYm7mkCJOGuU45qU0J4=; b=VBgfIteQsxfVGRmvBmYyrXNBx1aDExXPCs6urnbzCCOtgGlA0ydfIKuDP787axU2xz/wDGlePM4EL237GF9vxRzsBLldjBIn9si5ppN8pu/hZmOUzlsTt4k2bEMv5Se0LGTtYbXwmm6PsJhtCVeiSGAECyzkxsYFtpe33XvXAKw= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BYAPR10MB2725.namprd10.prod.outlook.com (2603:10b6:a02:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Thu, 10 Mar 2022 14:52:46 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ec69:8077:89b0:4379]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::ec69:8077:89b0:4379%6]) with mapi id 15.20.5061.021; Thu, 10 Mar 2022 14:52:46 +0000 From: Drew Adams Thread-Topic: [External] : bug#54296: Add buffer-matching functionality Thread-Index: AQHYNHiO4+foVpn8zUysorVKnzE6fKy4su4w Date: Thu, 10 Mar 2022 14:52:46 +0000 Message-ID: References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> In-Reply-To: <87cziudmyg.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 948e4d20-39ca-45c0-e7f0-08da02a5a3e7 x-ms-traffictypediagnostic: BYAPR10MB2725:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QpaICHP06fYBLfy66peKRwG9i1gV22x7dkOGgeHCy3PSbaWib9fUtX4JoMV18BvJEMnhTVUpy/SmbkEQp6h/K071l/ax0LskkmkgKQrlp8nmATGxw4c1x1s0citozz0nOZKtZcWAvaBi0ohUJnZJvHppcEPxtcCZJUXUPBMzLrEVcnfR+ySyuVtYTa527u5EfmSZlwhbeh3cDU80aareN7HQPOUwmsDLEkU8iyyhXvKujAH7uYutPmJnxzYGHb6NX7PGHOp3LwYsy7K3v+n9Etpc/M/OP0BSzdfGUcyQYuKgBiRxmgpPGLaV/6Bagnk61LrZYXrSIA8BPPyGbX0dZTsQu1qZBY89LxWTCfVeaPkwlR6RKF9dLNzuw5cDjT3JVgTda/MB5roYA1lxHkrhsM+dDXE72Ulgt+bYn1BFKY8TUV9cOUVkmpljxUFvhFfsuhuKnUnYyIf9spbx9gv6XCISfbBRAodffhFTDVikpl7RgJg1ACURIg/CVhR8XOsJfXD+eltjfGWqG7HIc3VyGmvZ6IhXd7iGx3tLEJm6dHO4VeCFs6Agdgizx9ynK4CQWRsUE9wDSK+HqGMh4iudK66wP/BIFRKTBQfnO+hqkZynvUk6Hs6OUg13ylrn4XIedVUQHswoAK/XZijQJDLwxa7Su7TWsAtzau8mrhe2++y6AgnaOpuk4hTu+7v7t4Ad8yGnbEYX+yEbHaCPITt1ew== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(44832011)(4744005)(8936002)(38100700002)(2906002)(52536014)(122000001)(55016003)(5660300002)(9686003)(6506007)(7696005)(86362001)(4326008)(33656002)(76116006)(316002)(508600001)(66476007)(66556008)(66446008)(66946007)(64756008)(8676002)(38070700005)(54906003)(110136005)(71200400001)(26005)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: FWaSOQg3IBPzoIeajOGRJ0AodjVkIsPqFBH//iGWoj3zM0X+q10uVS9uOVVP9OXHmfS061TwsCLt2w6/EY5FvPIvUyRLVhVdDwyhFlDW5CpiHRj58Px6sQkZPEuq5Nn48Ro9JS6Cc2patBTL+4LDEanGX60h6P8Om1UbsGJSB+5I+hrReKD1pwjpe0QfRQcdqb8a7Sf6n8eebQrQXH8c/UMzUDfhE1IH/LJx+Fa9ecxwGCsNS8r0VthFQe+0Yn1I3DbTnPI3kSBOJWdOn1tPtV/RZPpj261txVsjai493Jm4zAVUITtKbaB71Q3QtuGe/j0UGxEjFr54QM0X6Ipc6x50OvNLTW7NHtpu+DGaHTj48eJRBxwZQY2asBWOmWHhaR2Uc2AW7oUzecFaqvbwd5zTlh2IKf39qdy54jBcuInbagZsXpFnRwOahyo6Vw6USW4eZW/TUEHu+5GcyJ86eciS2Jb14pKVHPEricrg/JFUaXBk8oNPr7UOa70I2iRW4b0CFqHxh09sSINw0DL9lvw/ZISNnQidVd85/iZZUlO2kTlZy3fRFSx1dN4zqy60fuV7a7g+a5EECvekrlib7TFbFDdO0r9I3xX8ChOmTVw2HAirwj+z0KBHAprYuZT9T9n107jEE5jM3D50uuXNTjzM+HBWhYfjXUmWwMhlTW95p4SNk6qaSTgpQKQFn6yypqENizgMuJbGDe5tYnfRnJrx+vI3eHf04W0YNXNDxoqbPh30dIcWapfL0ZgRmDLGmqAoJQKNvewh/MyLfTm988dZt4UhGjFtVjFhn/jlM6glcILn24X7EiBD+qrTYH1i5gaQBZHFjQPAPhcI7x4Gs6S/7XKvGlDy0zfiIHfSpwQANwN0oGGwPUZweY0tf3AOTHRFxgqvL0mN+9VAWPhQaxPf53tthZTvKUKOYrPm+sIiVv3folgPqyt3mGcI8tXqafliIUl7hCsQQzWaFhaTFvz9HyXgFkCZHUnnNC5gaGz3t+wg+fJl/Q+cx6xks2Os7FAMN1pXvU/DiJ4YwuYimbCYD9TQz+D0Y7aXxNyu0i/c7oxGDZZ24olwF4FhyXZEK4KJeW23bIFWpkkWIcHgpviCc0wdlth80loWe5RoH20twc1O8IyjwLIR8aaWPTCPhf8j9KAuQl7/+i9R90jp92+i8BH2YmLHNo5QeYtGIrYPAYNshxByUlNnaRvdSPkr1mj3r7xnb4Q7LLpe06UiT8VJnSX8AvcBbKSDnelpq9Jnw7voBTPiR63mG3TrJIScSrbrfQUSknEB5blZJd93d8M/mOlABWMVbNydofAdf72b3fAekA/LCQHgW2+Tsk32ZKZm0AZihk4/276FzT9/gh67kGUUfQu75GBJVaYx6iVxqprO4GJ9Vmtz1n3PgfhMBNfp75JouRFmYmeiwoyVKJw637uC1xlSwDd2nQWm1ToZeNczLHvo4+GQW0CHnQUv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 948e4d20-39ca-45c0-e7f0-08da02a5a3e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2022 14:52:46.8777 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1pMWaiaXjcLhjn+RkSYWQIDKr9BrakyluKMXsXfHRis7BD7XavorO7r/cIt+YOE/bv+R/zfEJbeE7HWRmPgwSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2725 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10281 signatures=692062 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=822 bulkscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203100080 X-Proofpoint-ORIG-GUID: lUyTSYxtK8ZdGpeIy-QGE3X_78_l-sBx X-Proofpoint-GUID: lUyTSYxtK8ZdGpeIy-QGE3X_78_l-sBx X-Spam-Score: -0.7 (/) 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.7 (-) > > This is a predicate function, so its name should be buffer-matches-p > > or maybe buffer-matches-condition-p. >=20 > I like buffer-matches-p. (I'm not following this thread, BTW.) "Matching" typically has a connotation of pattern matching. In the case of Emacs it is especially about textual patterns matching text. If you're testing a buffer object, and not just its text or its name, then it's probably better to speak of the buffer "satisfying" a condition or a predicate than it is to speak of it "matching" a condition or a predicate. In general, patterns are matched; conditions and predicates are satisfied. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 15:43:02 +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 To: Philip Kaludercic , Lars Ingebrigtsen Cc: 54296@debbugs.gnu.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164692695526722 (code B ref 54296); Thu, 10 Mar 2022 15:43:02 +0000 Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 15:42:35 +0000 Received: from localhost ([127.0.0.1]:35283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSKvy-0006ww-Oh for submit@debbugs.gnu.org; Thu, 10 Mar 2022 10:42:34 -0500 Received: from mout.gmx.net ([212.227.17.21]:56701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSKvx-0006wb-6j for 54296@debbugs.gnu.org; Thu, 10 Mar 2022 10:42:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646926946; bh=DJwj7CdA1rnTPMOOxmdzwkfEzAQm6G5IPQlNz+mMOVI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ZKY/wwlZtLb+IOZ1US4MIwffjz/9wK/wPnTt9YcS+Ve2fBVaMY7huqd3hkXBX/JoX cWXJoJV3V+gAx2fSYvYAJC4lOkV69EOyfZyh0537M1CDrpNqS0usU/Cxmu/VarHJGU Y1o2zSerL85sqOYHKHNLW9AnDDu5jeytPsts9U1U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.102] ([212.95.5.125]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2Dx8-1o8uj60ZYc-013hKk; Thu, 10 Mar 2022 16:42:26 +0100 Message-ID: Date: Thu, 10 Mar 2022 16:42:25 +0100 MIME-Version: 1.0 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> From: martin rudalics In-Reply-To: <877d92unqn.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:cnTCHuhIeS+/DfFBXWFzyZFJgShRvRYy2KRVotf/5esYHsJ9q7g Fnw9nr05/i+Zwr8SbleFZVv7SqxajCcPZIFDsGEN2Vje8Bxv6kPXd6H/TjHbma54HEz46N1 d6lkdaspXzRHKAM3Fm6Lx2Tv+A0VQz4mlrO4F02hJkuo6YqDscmugBuQMsEQFU0ESka1KTZ g1lqIheSlD0f+VpH8stig== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0Op4u1+QkBQ=:OeKZtPqNlgulItw6hCp0St d7hEnDaAqdXCkSVv9bpvqk/tnll6cMNsiEPrFhuVVmaVmItGjR4QOU8sHXEJdEHvmxIQol139 6VfgkA68/ZoblY1pulM12+YaP7Hnn2avNsfo/6YoKSO+/HccfZ5IU57uRt6Slg3CQhmFsodgt zI79sfyZVvflheIKghfuMYTm1kFToYs8gKgA2L0QSYqTq9+bo1Idq/8Z/aZR2L0vEkAwXHkV5 3REcLb69nH1N5BKDpiIpRUsiYNBGr8p+2DkcsILgd+4nq/BNlWk3hiWRbyPE0kU+l9eGm6+bF 6CTxmSfl+krEllDYXGPXqY+5jzd8VjqIl2KSrzBTe5XVL5nKHQzo91qL28E5SBEXkLmdwQY7R 0IZ7gZaD33F5EX7lGdrr7gqqTu53Nnp3iurDbnoxpc01r1g1lzjx7axj4+jycn9XwFhVQVP7g 9ynJ5FeIzEtd5DEFDr6iDSdA4wqnz8GGR9NY+XTTyoRVrWITc0HhDCLyM3ad2lygM2Z7hbJ33 z0PU5NXjHmPS9LqYYwvmUBjjTo5xpSzKS2eu8fxUswmDJIHa4crqW9aWqq46hbLAV1Yhi3Pd9 VjrE05MD9gADQgeYVLzC87g4/PQ7TCwdsIrd8jyc0biNbZfU+SIIXuTPbcsLv8ktIXvmj4X6Z O82G/h9zTmpjpWhTJwbnTDKKDiSHR2lDYqckXR9J6qAIEHS9jteTAJgDeXMzM8hj96I/sat6D e2L5/wIXYkDN5tsgozWeA1+Er6gGwutJ2G0XZMiuITEbPXeHoV3faLCUi4ZZuYKzvLOxQzh5A q4LgwBY2gtYxMQvUKnDxFNac/4yYgg2qVbkBvWKuVWch9KV1pPUGBnEG81EQRA/JmZ47cotbj rlFiM3veEJXeb6JcjK/1pU+w6ENk7gTGbxgdZaq+eSo+bylrkoyBY9OInw0TnZs/AgTLMgU7g gfF4usgPA2KaqoYyxf2Xhyp2KVOiyAUigQ6lfP5B4QnuKjLvESyF9VfGBCtiPfGyVv7ffVZyU IkgMXfWVqd0PK+FhsaKI4SDeb5Wzuz80XX/xJKfoZXJe5NKv5y32GFJLV8artpaMnWy4Ou9dI Y3vr+w12cGZLjI= X-Spam-Score: -0.7 (/) 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.7 (-) > This seems to work, and updating window.el was also pretty trivial > (unless I have missed something): IIUC the doc-string would now say that This returns the cdr of the alist entry ALIST if either its key satisfied a BUFFER-NAME per `buffer-match'. which doesn't appear correct. In either case please make sure that your change does not affect existing behavior where a buffer is not displayed in a specific way because it does not match 'display-buffer-assq-regexp' until now. Thanks, martin From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Mar 2022 16:57:02 +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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16469313872645 (code B ref 54296); Thu, 10 Mar 2022 16:57:02 +0000 Received: (at 54296) by debbugs.gnu.org; 10 Mar 2022 16:56:27 +0000 Received: from localhost ([127.0.0.1]:35403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSM5T-0000gb-9z for submit@debbugs.gnu.org; Thu, 10 Mar 2022 11:56:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSM5R-0000gN-Fw for 54296@debbugs.gnu.org; Thu, 10 Mar 2022 11:56:25 -0500 Received: from [2001:470:142:3::e] (port=58960 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 1nSM5L-0000DQ-NL; Thu, 10 Mar 2022 11:56:19 -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=1tpEmXOxbAWLkICGKgjaNuq2yZpdZGrLmeCMdOJFy9w=; b=QzDfvmXYplY5 uFtsmeVlXbH6fJ4cvEuADjqGzY0PKaLe8i84XkOYuyMk8CTaMKJL3giyjZOXbG8d3o6ArVCuP4dPK nsk5CpITUcYKHnLE+1OahG+pkRwBW2T2WVG4m6GJ0YVhXxkNyAGIGAvYlHpP4yES7BVZ6iW+S4aXX GeNWPBA1UlOHyLRXZmOtY6npYfyL4RSXqZCwj/g4uYpZwaVDjJ2Nu7x+A1kTVQi4+Qp1zCgb3+uqF Z+4H4iLfB+I0CYlDLR7SA2hlmtLJyOAs722CQwLrVdvoR3osoLHe5oawqP6PMNauDa8eA28zkojyP zsmC90+nSJoCbnbdhdZojQ==; Received: from [87.69.77.57] (port=3583 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 1nSM5L-0003SE-5Q; Thu, 10 Mar 2022 11:56:19 -0500 Date: Thu, 10 Mar 2022 18:56:18 +0200 Message-Id: <838rtheogd.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87cziudmyg.fsf@posteo.net> (message from Philip Kaludercic on Thu, 10 Mar 2022 12:13:59 +0000) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) > From: Philip Kaludercic > Cc: larsi@gnus.org, 54296@debbugs.gnu.org > Date: Thu, 10 Mar 2022 12:13:59 +0000 > > > Do we really need both major-mode and derived-mode? > > It seems to have been useful in project.el, see > `project-kill-buffer-conditions'. In that case you want to both be able > to say something like "kill buffers only if they are in > fundamental-mode", but also something like "kill all buffers that are > based on comint-mode". So this is only because of fundamental-mode? If so, shouldn't it be enough to have a possibility to have a predicate function, which can do anything one likes? I think we want in general avoid comparison with major-mode, and prefer derived-mode instead, and if so, IMO we had better did as we say and not exposed comparison to major mode unless we absolutely must. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Mar 2022 16:22:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164701567615863 (code B ref 54296); Fri, 11 Mar 2022 16:22:02 +0000 Received: (at 54296) by debbugs.gnu.org; 11 Mar 2022 16:21:16 +0000 Received: from localhost ([127.0.0.1]:38273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSi0y-00047l-1M for submit@debbugs.gnu.org; Fri, 11 Mar 2022 11:21:16 -0500 Received: from mout01.posteo.de ([185.67.36.65]:33761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSi0v-00047V-T0 for 54296@debbugs.gnu.org; Fri, 11 Mar 2022 11:21:14 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C7A72240027 for <54296@debbugs.gnu.org>; Fri, 11 Mar 2022 17:21:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647015667; bh=0s4HFa/MPe//o0tN+4zYDm45pC5no/oy6QxBDgtSVzA=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=p9fjuFJTdwYbdwTI/q40h3UHaLnUI4fs4L/i3OtJy6VjhJx62+BnCpg7/dlS3t0AC 9H0/MbmnF4VmqkwnthZsyTFFCT8c6mnTFfTUwoooN2tOu5JX8S1vnh53zoEb+se+WP vo6VhJXG2WRw+zYZCitjDDgG6VxucC1uqXm7rvBTgdAGaQWMPhR6KZDBv5CTpmSQ2k nLHZRPJAA8L21GG4MdtTU21Q4FBdMtbhFTzrT2+jyzEu5/cn98ItKRN26Qs6F3W4I2 PRoF4h/Mmeith5Nl0rTbq52/tUoBfxEZYsFGi7XwRWzJUDTdx+7G9hsT78UfNyOw90 91ZA6rRnzqt3w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KFWQB6gpqz6tm5; Fri, 11 Mar 2022 17:21:06 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.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: Fri, 11 Mar 2022 16:21:06 +0000 In-Reply-To: <838rtheogd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 10 Mar 2022 18:56:18 +0200") Message-ID: <87ilskbgul.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: >> From: Philip Kaludercic >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> Date: Thu, 10 Mar 2022 12:13:59 +0000 >> >> > Do we really need both major-mode and derived-mode? >> >> It seems to have been useful in project.el, see >> `project-kill-buffer-conditions'. In that case you want to both be able >> to say something like "kill buffers only if they are in >> fundamental-mode", but also something like "kill all buffers that are >> based on comint-mode". > > So this is only because of fundamental-mode? I wouldn't say so, that is a known use-case, that is one I know of right now, but there is no reason something like that couldn't come up again? > If so, shouldn't it be enough to have a possibility to have a > predicate function, which can do anything one likes? Everything this patch introduces could be replace by a predicate, but the other issue is that if the major-mode/derived-mode distinction is removed the function couldn't be used in project.el anymore, or would have to break compatibility. > I think we want in general avoid comparison with major-mode, and > prefer derived-mode instead, and if so, IMO we had better did as we > say and not exposed comparison to major mode unless we absolutely > must. Would it be enough to clarify this point in the documentation string? -- Philip Kaludercic From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Mar 2022 18:35:02 +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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164702364830166 (code B ref 54296); Fri, 11 Mar 2022 18:35:02 +0000 Received: (at 54296) by debbugs.gnu.org; 11 Mar 2022 18:34:08 +0000 Received: from localhost ([127.0.0.1]:38376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSk5Y-0007qT-Ab for submit@debbugs.gnu.org; Fri, 11 Mar 2022 13:34:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSk5W-0007px-8x for 54296@debbugs.gnu.org; Fri, 11 Mar 2022 13:34:07 -0500 Received: from [2001:470:142:3::e] (port=56884 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 1nSk5Q-0004Yt-QR; Fri, 11 Mar 2022 13:34:00 -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=PE4zqfV4QzYNzA2PtyaYwYyU8JQ/3iKyZqAvYHJ4ku8=; b=n1oswLCeS3d5 1+XlUnZRYib5pMaOmgfjwovCB2Ua0anQwMM5e/aoQ7VHnxPXc9cI+Ase7BW/pV/Yan/iRCCilQpdD nHU7Azmycr0YA/fel+Fc6449wjme8cR4VxtsDJ7AU/tKTBPoM1/5lwux2HTpQxaGyl5cAU0HHxnPV QHaW2hMTFNgUqodsgaz1odZ7TQqJyDjVnvIl+AbHhcOQ1/qQwq3dnQ3Dd0ctbD2zDCcFM0DFuM8p8 iUFm4IdbCmys0UdJjY//NfOeAZkyiz9vIW0XNsEC2SSYRqxkqiTzoV1dzlEkr/7DTrrzsJLfjF7u7 BuE+kjDWaPYPR7nvFxOXqw==; Received: from [87.69.77.57] (port=2216 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 1nSk5Q-00088N-8W; Fri, 11 Mar 2022 13:34:00 -0500 Date: Fri, 11 Mar 2022 20:34:01 +0200 Message-Id: <83ilskcp9i.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ilskbgul.fsf@posteo.net> (message from Philip Kaludercic on Fri, 11 Mar 2022 16:21:06 +0000) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) > From: Philip Kaludercic > Cc: larsi@gnus.org, 54296@debbugs.gnu.org > Date: Fri, 11 Mar 2022 16:21:06 +0000 > > > I think we want in general avoid comparison with major-mode, and > > prefer derived-mode instead, and if so, IMO we had better did as we > > say and not exposed comparison to major mode unless we absolutely > > must. > > Would it be enough to clarify this point in the documentation string? What would you like to clarify? From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Mar 2022 10:24:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, Philip Kaludercic , larsi@gnus.org, Stefan Monnier Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164708061110678 (code B ref 54296); Sat, 12 Mar 2022 10:24:02 +0000 Received: (at 54296) by debbugs.gnu.org; 12 Mar 2022 10:23:31 +0000 Received: from localhost ([127.0.0.1]:39146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSyuJ-0002m9-74 for submit@debbugs.gnu.org; Sat, 12 Mar 2022 05:23:31 -0500 Received: from mail-ej1-f41.google.com ([209.85.218.41]:40777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSyuI-0002ly-6X for 54296@debbugs.gnu.org; Sat, 12 Mar 2022 05:23:30 -0500 Received: by mail-ej1-f41.google.com with SMTP id p15so24019026ejc.7 for <54296@debbugs.gnu.org>; Sat, 12 Mar 2022 02:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=3yijDo8tx8IsVXtRldpl+sTzARkhTffflzShGbhP+wQ=; b=I4NDaoc6W4LhECb8Gt3JtTDo1trV+Fo8neLk88V6KMxiG6o0CXBdHQa+akq15ud4+s i6KPnX/qu7wCJmyeoYLW6/LZt5ICQ2bdMzFpEZIQ6b9q+vFxNZBrqMW+Wg9e4sHdaa/7 HTLsEK0thTeiBJxUOfG8wdAYXQhG9a+rx8KDBJdU4kqL8xCdmC163aDKQLZrj/pxiAXd qiFnfMyyvsNLGtuZXeRFmGsnFMOR3qFYnv4jpAIlryaoItM5HmooxL+bUa+KKVpd3rlC MmMAc9euPHKnTqvSlY2arOSZqmmqIexby0EM9Nodsc/hP77n4WuUOrDtjZucfMdO+hzP ZarQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=3yijDo8tx8IsVXtRldpl+sTzARkhTffflzShGbhP+wQ=; b=CgX0+H83pvs34QeA3tTsAjrLduccbxwFq8KlgAXmeC5hNnZr8L3yQX01WCs/69cqJZ H2Z8RqBbYdav/uXnr24SYAd3pA5olsp7c8luQ78Ke847yT6wOGv3filqugE9BQGbcGI+ zgpgOqBUnfqmEah5JFHqypMwaSD988abQToGMxu5SY8O+Tf3o2BBfKFnMkVBVD/xC2fN fWJ0tEkPiGWIPL5yhwao8whjWTYv4J0chj6eLrlOXbmHdm0egGcm3iZzlOXgpBVowxJG k/SaFTqK1AnBMTbePAvWQKOIkRpBcM+BXbNtFwHHvnaLU665D3OTAeAnEvBdJnGdC/4W oytQ== X-Gm-Message-State: AOAM531tEetHEEbKVkk+tujnLH0GAdgfHgLnAutIyKehMEbGCyoWIfCu 85Z0mrGDuCzqkZ5dwWcPZpw= X-Google-Smtp-Source: ABdhPJw+SORylH0ecsYu6kxHZoVNyPQzzziEv0ws5eDev3cEu5/X6AVzAdIrhPCi+ro5EhNzgfinNg== X-Received: by 2002:a17:907:6e88:b0:6da:8f01:7a8f with SMTP id sh8-20020a1709076e8800b006da8f017a8fmr11571377ejc.619.1647080604176; Sat, 12 Mar 2022 02:23:24 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::758e]) by smtp.gmail.com with ESMTPSA id hg11-20020a1709072ccb00b006cee4fb36c7sm4198935ejc.64.2022.03.12.02.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 02:23:23 -0800 (PST) From: Augusto Stoffel References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> Date: Sat, 12 Mar 2022 11:23:22 +0100 In-Reply-To: <83bkyednvx.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 10 Mar 2022 13:53:54 +0200") Message-ID: <878rtfwjtx.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-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 (-) Coincidentally, I've been discussing with Stefan a similar mini-language for the 'font-lock-ignore' feature. Here are some thoughts On Thu, 10 Mar 2022 at 13:53, Eli Zaretskii wrote: >> +- 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? It seems handy to allow (mode MODE) to match a buffer with major mode derived from MODE or if MODE is bound and true as a variable in that buffer (say, it's the name of a minor 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." ^^^^^^^^^ In 'font-lock-ignore' you can prefix an or-condition with !, with the gitignore semantics. This seems very appropriate for a buffer-matching functionality. But then `or' is not the familiar short-circuiting operation, and you need to evaluate the conditions backwards... On a more bikesheddy note, I'm also debating a bit what is more readable: (or cond1 cond2 ! cond2) or else (or cond1 cond2 (except cond2)) From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Mar 2022 11:09: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 To: Augusto Stoffel Cc: 54296@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org, Stefan Monnier Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164708328215256 (code B ref 54296); Sat, 12 Mar 2022 11:09:01 +0000 Received: (at 54296) by debbugs.gnu.org; 12 Mar 2022 11:08:02 +0000 Received: from localhost ([127.0.0.1]:39294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSzbO-0003y0-Bp for submit@debbugs.gnu.org; Sat, 12 Mar 2022 06:08:02 -0500 Received: from mout01.posteo.de ([185.67.36.65]:39859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSzbM-0003xW-EY for 54296@debbugs.gnu.org; Sat, 12 Mar 2022 06:08:00 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 92E56240027 for <54296@debbugs.gnu.org>; Sat, 12 Mar 2022 12:07:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647083274; bh=AMJgNV8QCHvzvKvZ79Y+zvTLxATb1+MorU/IPff1T/g=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=XugQ+OxxITH38d1YdZ0Y3j7xWXuD1B67g6aWHZXgryihvfTplorMROIidgXOwoJkK 0EAG+XN85ci5YRriBVDq+TPCsECvwV5+QWOpsGzWjG8pmqqthiIZdvo1FiYWFjvbc4 9X+bB4RtnovrID+1MLDFGd1Z8nJeiYIPZV70MF0bK9z0BZ0FXhO9gWw2OYLiqZgZWy vRj/dKjwuhpw7/rN+OwEFNwzxK+p4/gkY9YhRP7gYZcxiY4U/l45z6PWVPcz/OOScV U0h3L1vsVUMKu9iN0I6YV7kjujyCNBBjrixIhBNEdb+/jTFX6GqE7aRjJ/vuP7+mFh 8jZmXzbzG4uWA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KG0QK0wf0z6tmg; Sat, 12 Mar 2022 12:07:52 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <878rtfwjtx.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: Sat, 12 Mar 2022 11:07:51 +0000 In-Reply-To: <878rtfwjtx.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 12 Mar 2022 11:23:22 +0100") Message-ID: <87v8wjjuns.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: >>> + * `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." ^^^^^^^^^ > > In 'font-lock-ignore' you can prefix an or-condition with !, with the > gitignore semantics. This seems very appropriate for a buffer-matching > functionality. > > But then `or' is not the familiar short-circuiting > operation, and you need to evaluate the conditions backwards... > > On a more bikesheddy note, I'm also debating a bit what is more > readable: > > (or cond1 cond2 ! cond2) > > or else > > (or cond1 cond2 (except cond2)) If this would be included, I would certainly prefer the latter. -- Philip Kaludercic From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Mar 2022 20:41:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164720405814750 (code B ref 54296); Sun, 13 Mar 2022 20:41:02 +0000 Received: (at 54296) by debbugs.gnu.org; 13 Mar 2022 20:40:58 +0000 Received: from localhost ([127.0.0.1]:43442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTV1O-0003pq-Aa for submit@debbugs.gnu.org; Sun, 13 Mar 2022 16:40:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]:44745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTV1M-0003pe-KY for 54296@debbugs.gnu.org; Sun, 13 Mar 2022 16:40:57 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0A22B240028 for <54296@debbugs.gnu.org>; Sun, 13 Mar 2022 21:40:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647204051; bh=1Ek6EKDLAiHlmSv4yxVOKYUuiqiGubGdOumM6MkoaQw=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=gaqXrAiEKV2XwpGs4v4G0Wx95FISuZlLe1Z0N5KW6TB9LxhY+kCuXbBtQ3aLrrPi7 SnPQXSXGicTwnMq6mjEAk1F4gIyXohy1zKr4hvu/Ev+2BDA8DKhUgQFVnvwepTtA8R 9V6Ywi7VlJcAr+kA+1i9Tt5yF0zeybfvtNWMCUB2jZpXIMG4tAwILxeaAZn9NVUoRE iaZL2bkoWBDNvR8U2/snzYUYQs1HEJhzfmLMf8YL9k3R/gW7xyhSrD+wwMXxGxI4/X xrcd8UDuEWZRs5Qail2a2QnvM0Ds8Ozt7IPz1Rqt0oI96oO/0oCAEta7/dhBafQxNX iZC63kudcAMeg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KGs4y21Xfz9rxN; Sun, 13 Mar 2022 21:40:50 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.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: Sun, 13 Mar 2022 20:40:49 +0000 In-Reply-To: <83ilskcp9i.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Mar 2022 20:34:01 +0200") Message-ID: <87v8whio1a.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: >> From: Philip Kaludercic >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> Date: Fri, 11 Mar 2022 16:21:06 +0000 >> >> > I think we want in general avoid comparison with major-mode, and >> > prefer derived-mode instead, and if so, IMO we had better did as we >> > say and not exposed comparison to major mode unless we absolutely >> > must. >> >> Would it be enough to clarify this point in the documentation string? > > What would you like to clarify? To clarify that the usage of (major-mode . foo-mode) might not be what the user intends, and that in most cases derived-mode is preferable. -- Philip Kaludercic From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2022 03:23: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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164722812828688 (code B ref 54296); Mon, 14 Mar 2022 03:23:01 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Mar 2022 03:22:08 +0000 Received: from localhost ([127.0.0.1]:43688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTbHc-0007Se-IM for submit@debbugs.gnu.org; Sun, 13 Mar 2022 23:22:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTbHa-0007S9-EH for 54296@debbugs.gnu.org; Sun, 13 Mar 2022 23:22:07 -0400 Received: from [2001:470:142:3::e] (port=39186 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 1nTbHU-0001Yt-Rk; Sun, 13 Mar 2022 23:22:00 -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=yPSV9yLYWbm1pD6NdAGF4sYxN6uX/Mj0hoelHmrVcBo=; b=Pi4MRkPzaDiC 3zC296HkNBTUDousZ1oeCRSwN+BDGnhmMZq4IPyH93E3mZ7b0bUklMOgAcJfW+yiz7oThVx5FuH/y jMxuR1jo2Qe29eP+Q5x760eD9CKEHeFc/42a+YymxlWCbE6oB8SgtfUgcDJJS9rbCG6sU8RHl4+kn ntDpnnelFDy2eO+6d3WNv1FTWNv4doeJ2hX2TNMeNcOQYUKBSmHb9r4CrLGw+HSK4nmDF/QqyHCzG HAORqCcX1YtIB5Zfv3uYF6rvs9ycg6dSc3UU5og+eSdkE7y1ytrghYerQL3DG1xSeJwi4syN14FBE OxN/8O1oa/agf5vCy2+xyg==; Received: from [87.69.77.57] (port=1308 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 1nTbHU-0003fQ-As; Sun, 13 Mar 2022 23:22:00 -0400 Date: Mon, 14 Mar 2022 05:21:47 +0200 Message-Id: <83czipkylw.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87v8whio1a.fsf@posteo.net> (message from Philip Kaludercic on Sun, 13 Mar 2022 20:40:49 +0000) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) > From: Philip Kaludercic > Cc: larsi@gnus.org, 54296@debbugs.gnu.org > Date: Sun, 13 Mar 2022 20:40:49 +0000 > > Eli Zaretskii writes: > > >> From: Philip Kaludercic > >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org > >> Date: Fri, 11 Mar 2022 16:21:06 +0000 > >> > >> > I think we want in general avoid comparison with major-mode, and > >> > prefer derived-mode instead, and if so, IMO we had better did as we > >> > say and not exposed comparison to major mode unless we absolutely > >> > must. > >> > >> Would it be enough to clarify this point in the documentation string? > > > > What would you like to clarify? > > To clarify that the usage of (major-mode . foo-mode) might not be what > the user intends, and that in most cases derived-mode is preferable. I suggested to "clarify" that by not providing the 'major-mode' predicate at all. I still don't think I understand why it is so important that we should provide a special case for it. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2022 08:23:03 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164724612526037 (code B ref 54296); Mon, 14 Mar 2022 08:23:03 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Mar 2022 08:22:05 +0000 Received: from localhost ([127.0.0.1]:44002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTfxt-0006lr-DT for submit@debbugs.gnu.org; Mon, 14 Mar 2022 04:22:05 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTfxr-0006lM-Us for 54296@debbugs.gnu.org; Mon, 14 Mar 2022 04:22:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1A370240106 for <54296@debbugs.gnu.org>; Mon, 14 Mar 2022 09:21:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647246118; bh=bmbK5ZwKbNZcOBsfCVgsflpDfGKtaKp9ISaI93OFCnU=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=R2OmuS2oO2/WboQfCxH0BFa7oT9K8kpI7tonh6m/tYrxi/yO7vUaSK1CAMVM9+4RJ LxvF+VMNNlhv52LgNDOApRoXOvi/tBXsmHIh/3XIvEWDwZTjVb5DcdHqmlNF6UKWNu mHR2jHmCmYhbL7gwtA7FOmTJyznR+nRrBALfbhCGw4vrp60q1Vkf/FdivqEZiQzxOA Whxs+LXWnLEdu7aXjMDjMxVzRGshN6q7OSFLr8YGEWpv+gYzLVaBGeM1SuXKKzz7x8 TLxWgIA4wUyexkbT7ebRUJ+1UWIQeGfnwo8gxbWwg/NfqsdzXi7tVptgOy+QSddjTL Zni2iIku3FdjQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KH8dx0k3vz6tn3; Mon, 14 Mar 2022 09:21:57 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.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: Mon, 14 Mar 2022 08:21:56 +0000 In-Reply-To: <83czipkylw.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 05:21:47 +0200") Message-ID: <87pmmp9c63.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: >> From: Philip Kaludercic >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> Date: Sun, 13 Mar 2022 20:40:49 +0000 >> >> Eli Zaretskii writes: >> >> >> From: Philip Kaludercic >> >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> >> Date: Fri, 11 Mar 2022 16:21:06 +0000 >> >> >> >> > I think we want in general avoid comparison with major-mode, and >> >> > prefer derived-mode instead, and if so, IMO we had better did as we >> >> > say and not exposed comparison to major mode unless we absolutely >> >> > must. >> >> >> >> Would it be enough to clarify this point in the documentation string? >> > >> > What would you like to clarify? >> >> To clarify that the usage of (major-mode . foo-mode) might not be what >> the user intends, and that in most cases derived-mode is preferable. > > I suggested to "clarify" that by not providing the 'major-mode' > predicate at all. I still don't think I understand why it is so > important that we should provide a special case for it. It is not inherently important, it is just that if the predicate would also be used in project.el, then compatibility would have to be broken, as the distinction between `major-mode' and `derived-mode' exists there. -- Philip Kaludercic From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2022 13:01: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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.1647262841610 (code B ref 54296); Mon, 14 Mar 2022 13:01:01 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Mar 2022 13:00:41 +0000 Received: from localhost ([127.0.0.1]:44332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkJV-00009m-BP for submit@debbugs.gnu.org; Mon, 14 Mar 2022 09:00:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkJT-00009Y-O0 for 54296@debbugs.gnu.org; Mon, 14 Mar 2022 09:00:40 -0400 Received: from [2001:470:142:3::e] (port=46998 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 1nTkJO-00036E-9T; Mon, 14 Mar 2022 09:00:34 -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=fQaKSOuH7ug+1IkEN0xSaunHs/FlEnzTF5C9DFF905U=; b=R/9BMgJZ8PgI I4YTYq72ZnOPWYvuNED4xGubz9ixET4gTwWPbBkSrJhsZkp14QdA31BWJysArqFmsf2GOKtsGR/Vr QsWx4nuglcTsmhGJUa7xKjkeA8FiUTZxMq9O5VfukdMEIFvOj0BCmlEuR8onmHghLuvuliblX8yts gfrb6uvLtYiraHOXsl7ULa05eu5EXN/S0kBxJX7zKGMz6g2L9RNGn6HV4OSkg65vAHyJCk772rz/S VfezYM9bvr+qAuM8lC8FQ6KvO9IytWGXou6tgpdVeyI/eYf4GkTE8R6j4gXFpAdBXtovAUNeQ27qG we59yITGNtf5dvgKcxjcIA==; Received: from [87.69.77.57] (port=4770 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 1nTkJN-0004Er-Md; Mon, 14 Mar 2022 09:00:34 -0400 Date: Mon, 14 Mar 2022 15:00:20 +0200 Message-Id: <83v8wgk7tn.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87pmmp9c63.fsf@posteo.net> (message from Philip Kaludercic on Mon, 14 Mar 2022 08:21:56 +0000) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) > From: Philip Kaludercic > Cc: larsi@gnus.org, 54296@debbugs.gnu.org > Date: Mon, 14 Mar 2022 08:21:56 +0000 > > Eli Zaretskii writes: > > >> From: Philip Kaludercic > >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org > >> Date: Sun, 13 Mar 2022 20:40:49 +0000 > >> > >> Eli Zaretskii writes: > >> > >> >> From: Philip Kaludercic > >> >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org > >> >> Date: Fri, 11 Mar 2022 16:21:06 +0000 > >> >> > >> >> > I think we want in general avoid comparison with major-mode, and > >> >> > prefer derived-mode instead, and if so, IMO we had better did as we > >> >> > say and not exposed comparison to major mode unless we absolutely > >> >> > must. > >> >> > >> >> Would it be enough to clarify this point in the documentation string? > >> > > >> > What would you like to clarify? > >> > >> To clarify that the usage of (major-mode . foo-mode) might not be what > >> the user intends, and that in most cases derived-mode is preferable. > > > > I suggested to "clarify" that by not providing the 'major-mode' > > predicate at all. I still don't think I understand why it is so > > important that we should provide a special case for it. > > It is not inherently important, it is just that if the predicate would > also be used in project.el, then compatibility would have to be broken, > as the distinction between `major-mode' and `derived-mode' exists there. Then project.el could use the predicate route, right? It's quite a special case, AFAIU, so having a special solution is OK. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2022 13:39:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16472651384484 (code B ref 54296); Mon, 14 Mar 2022 13:39:02 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Mar 2022 13:38:58 +0000 Received: from localhost ([127.0.0.1]:44400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkuX-0001AF-QB for submit@debbugs.gnu.org; Mon, 14 Mar 2022 09:38:58 -0400 Received: from mout02.posteo.de ([185.67.36.66]:57747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTkuW-0001A0-06 for 54296@debbugs.gnu.org; Mon, 14 Mar 2022 09:38:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1CA53240101 for <54296@debbugs.gnu.org>; Mon, 14 Mar 2022 14:38:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1647265130; bh=3LV6i5z6lolOHRsZp46Pz8V3i4hMDVfOiSkMdvRRPP0=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=lqEGctoNRPM17BrL9IhAaMq1nX3R1uWJTg/aDZQHYGCZe39sfqdr99xYsDOQ18c/X e9cEatv8OsN2PUGG/uIBhRoOoiKWZe8YFObY9Y9cMvTge6wQGcZvrMUxp6T0arWvPS 1dL8eQRNoikSGkICbe2TS3LNR4UH55kCuAyhwfbV91CFbsPRQZFu4bGhOboQTTjXUh ntzKcVkvgrfpC5LaQCJz5nbgJm0ZMsh0kvHcTIC5+w4BcDXdVmPcWKHI7VClI0SMsQ ZVTqChII4aiBZtwF4lhROG5MKBcOY1hBy4/hQGf+XrPZP7f/owkrI8eLBZsxRZuLLB j0ZvogyBjtHYw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KHHgY4Xznz9rxM; Mon, 14 Mar 2022 14:38:49 +0100 (CET) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.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: Mon, 14 Mar 2022 13:38:49 +0000 In-Reply-To: <83v8wgk7tn.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 15:00:20 +0200") Message-ID: <87sfrk3b86.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-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: >> From: Philip Kaludercic >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> Date: Mon, 14 Mar 2022 08:21:56 +0000 >>=20 >> Eli Zaretskii writes: >>=20 >> >> From: Philip Kaludercic >> >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> >> Date: Sun, 13 Mar 2022 20:40:49 +0000 >> >>=20 >> >> Eli Zaretskii writes: >> >>=20 >> >> >> From: Philip Kaludercic >> >> >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> >> >> Date: Fri, 11 Mar 2022 16:21:06 +0000 >> >> >>=20 >> >> >> > I think we want in general avoid comparison with major-mode, and >> >> >> > prefer derived-mode instead, and if so, IMO we had better did as= we >> >> >> > say and not exposed comparison to major mode unless we absolutely >> >> >> > must. >> >> >>=20 >> >> >> Would it be enough to clarify this point in the documentation stri= ng? >> >> > >> >> > What would you like to clarify? >> >>=20 >> >> To clarify that the usage of (major-mode . foo-mode) might not be what >> >> the user intends, and that in most cases derived-mode is preferable. >> > >> > I suggested to "clarify" that by not providing the 'major-mode' >> > predicate at all. I still don't think I understand why it is so >> > important that we should provide a special case for it. >>=20 >> It is not inherently important, it is just that if the predicate would >> also be used in project.el, then compatibility would have to be broken, >> as the distinction between `major-mode' and `derived-mode' exists there. > > Then project.el could use the predicate route, right? It's quite a > special case, AFAIU, so having a special solution is OK. The issue isn't that the default value couldn't be updated, but that if anyone has e.g. been using `project-kill-buffer-conditions' over the last 1=C2=BD years and has relied on the specific distinction between `major-mode' and `derived-mode', they would run in to unexpected results, that might result in more buffers being killed than intended, potentially data being lost that the user might not expect because of an update. --=20 Philip Kaludercic From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Apr 2022 08:27: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.164992477627496 (code B ref 54296); Thu, 14 Apr 2022 08:27:01 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Apr 2022 08:26:16 +0000 Received: from localhost ([127.0.0.1]:55065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neunv-00079P-C1 for submit@debbugs.gnu.org; Thu, 14 Apr 2022 04:26:16 -0400 Received: from mout01.posteo.de ([185.67.36.65]:53913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neunm-00078i-Oj for 54296@debbugs.gnu.org; Thu, 14 Apr 2022 04:26:13 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 853D624002A for <54296@debbugs.gnu.org>; Thu, 14 Apr 2022 10:26:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1649924760; bh=rMI/wCVMZcMd2SEvIO1oRkBX15tTmgj2SLG6zmscOYs=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=kHE8peNkKI9dkv12Snlwv3IQ+1UYrJ2jzS5GXcUMPTvhSk08ElNjBxJ2k4w/ZiGk5 0v5MmtmBLFQvn3w1oV46m3orr3zxcEiMTxGPqF2JDRbm+2b2SS1dq/bsSXEWqDn9C/ UI66MZ7VGda45WM5SL4crV5p/YGcqvDiF8qfv/DhB5nf18E+x2OYlY0gRNkrwYqbfy 7J+Rgr5enuhmD91P6G5d2tPFHsN6kq2tCmtoDpq2yRxVHiiePnzJuO61kFiwfMsfMm f+KDJA+ed3ZY1mMicvlbCP5BatGOnIkiBk81kl19Qjjeed11YH8O/xclTr6NfLFjhp aq/J7a59RIghg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KfCGH38hrz6tmT; Thu, 14 Apr 2022 10:25:59 +0200 (CEST) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.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: Thu, 14 Apr 2022 08:25:58 +0000 In-Reply-To: <83v8wgk7tn.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Mar 2022 15:00:20 +0200") Message-ID: <87a6co5aw9.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) 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 Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> Date: Mon, 14 Mar 2022 08:21:56 +0000 >> >> Eli Zaretskii writes: >> >> >> From: Philip Kaludercic >> >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> >> Date: Sun, 13 Mar 2022 20:40:49 +0000 >> >> >> >> Eli Zaretskii writes: >> >> >> >> >> From: Philip Kaludercic >> >> >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> >> >> Date: Fri, 11 Mar 2022 16:21:06 +0000 >> >> >> >> >> >> > I think we want in general avoid comparison with major-mode, and >> >> >> > prefer derived-mode instead, and if so, IMO we had better >> >> >> > did as we >> >> >> > say and not exposed comparison to major mode unless we >> >> >> > absolutely >> >> >> > must. >> >> >> >> >> >> Would it be enough to clarify this point in the documentation >> >> >> string? >> >> > >> >> > What would you like to clarify? >> >> >> >> To clarify that the usage of (major-mode . foo-mode) might not be >> >> what >> >> the user intends, and that in most cases derived-mode is preferable. >> > >> > I suggested to "clarify" that by not providing the 'major-mode' >> > predicate at all. I still don't think I understand why it is so >> > important that we should provide a special case for it. >> >> It is not inherently important, it is just that if the predicate would >> also be used in project.el, then compatibility would have to be broken, >> as the distinction between `major-mode' and `derived-mode' exists there. > > Then project.el could use the predicate route, right? It's quite a > special case, AFAIU, so having a special solution is OK. I have updated the commits as you recommended, and add a commit deprecating the use of `derived-mode' in project.el. -- Philip Kaludercic --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Generalise-buffer-matching-from-project.el.patch >From f218d19837ce53e5b94d16356594a5f48bd8f3d1 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 7 Mar 2022 20:49:42 +0100 Subject: [PATCH 1/3] Generalise buffer matching from project.el * subr.el (buffer-match): Add function to check if a buffer satisfies a condition. (match-buffers): Returns all buffers that satisfy a condition. --- lisp/subr.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index e7d5d36461..d0b73db019 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6651,4 +6651,63 @@ string-lines If OMIT-NULLS, empty lines will be removed from the results." (split-string string "\n" omit-nulls)) +(defun buffer-match-p (condition buffer-or-name &optional arg) + "Return non-nil if BUFFER-OR-NAME matches CONDITION. +CONDITION is either: +- 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, +- 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 derived from the major mode denoted by the cons-cell's + cdr + * `not': the cdr 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 + least one has to be met." + (letrec + ((buffer (get-buffer buffer-or-name)) + (match + (lambda (conditions) + (catch 'match + (dolist (condition conditions) + (when (cond + ((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) + (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 conditions) + (unless (funcall match c) + (throw 'fail nil))) + t))) + (throw 'match t))))))) + (funcall match (list condition)))) + +(defun match-buffers (condition &optional buffers arg) + "Return a list of buffers that match CONDITION. +See `buffer-match' for details on CONDITION. By default all +buffers are checked, this can be restricted by passing an +optional argument BUFFERS, set to a list of buffers to check. +ARG is passed to `buffer-match', for predicate conditions in +CONDITION." + (let (bufs) + (dolist (buf (or buffers (buffer-list))) + (when (buffer-match-p condition (get-buffer buf) arg) + (push buf bufs))) + bufs)) + ;;; subr.el ends here -- 2.34.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-window.el-display-buffer-assq-regexp-Use-buffer-matc.patch >From b6e03a6d4dda8db47405475675f2defb5b8520d9 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 10 Mar 2022 10:59:52 +0100 Subject: [PATCH 2/3] * window.el (display-buffer-assq-regexp): Use buffer-match --- lisp/window.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index dd297a3169..2da2f8bb2c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7498,19 +7498,12 @@ display-buffer-fallback-action (defun display-buffer-assq-regexp (buffer-name alist action) "Retrieve ALIST entry corresponding to BUFFER-NAME. This returns the cdr of the alist entry ALIST if either its key -is a string that matches BUFFER-NAME, as reported by -`string-match-p'; or if the key is a function that returns -non-nil when called with three arguments: the ALIST key, -BUFFER-NAME and ACTION. ACTION should have the form of the -action argument passed to `display-buffer'." +satisfied a BUFFER-NAME per `buffer-match'. ACTION should have +the form of the action argument passed to `display-buffer'." (catch 'match (dolist (entry alist) - (let ((key (car entry))) - (when (or (and (stringp key) - (string-match-p key buffer-name)) - (and (functionp key) - (funcall key buffer-name action))) - (throw 'match (cdr entry))))))) + (when (buffer-match-p (car entry) buffer-name action) + (throw 'match (cdr entry)))))) (defvar display-buffer--same-window-action '(display-buffer-same-window -- 2.34.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Update-project-kill-buffer-conditions-to-match-buffe.patch >From 1f2e73890f378ee4a25a6bcd2683f922115a4a58 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 14 Apr 2022 10:24:27 +0200 Subject: [PATCH 3/3] Update project-kill-buffer-conditions to match buffer-match-p * project.el (project-kill-buffer-conditions): Document the deprecation of the use of derived-mode (project--buffer-check): Have `major-mode' behave like `derived-mode' did previously, and issue a warning of `derived-mode' is used. --- lisp/progmodes/project.el | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index daaf86f327..1d04c19906 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1203,16 +1203,20 @@ project-display-buffer-other-frame (defcustom project-kill-buffer-conditions '(buffer-file-name ; All file-visiting buffers are included. ;; Most of the temp buffers in the background: - (major-mode . fundamental-mode) + (lambda (buf) + (not (eq (buffer-local-value 'major-mode buf) + 'fundamental-mode))) ;; non-text buffer such as xref, occur, vc, log, ... - (and (derived-mode . special-mode) - (not (major-mode . help-mode))) - (derived-mode . compilation-mode) - (derived-mode . dired-mode) - (derived-mode . diff-mode) - (derived-mode . comint-mode) - (derived-mode . eshell-mode) - (derived-mode . change-log-mode)) + (and (major-mode . special-mode) + (lambda (buf) + (not (eq (buffer-local-value 'major-mode buf) + 'help-mode)))) + (major-mode . compilation-mode) + (major-mode . dired-mode) + (major-mode . diff-mode) + (major-mode . comint-mode) + (major-mode . eshell-mode) + (major-mode . change-log-mode)) "List of conditions to kill buffers related to a project. This list is used by `project-kill-buffers'. Each condition is either: @@ -1222,10 +1226,11 @@ project-kill-buffer-conditions - a cons-cell, where the car describes how to interpret the cdr. The car can be one of the following: * `major-mode': the buffer is killed if the buffer's major - mode is eq to the cons-cell's cdr - * `derived-mode': the buffer is killed if the buffer's major mode is derived from the major mode denoted by the cons-cell's - cdr + cdr. + * `derived-mode': the buffer is killed if the buffer's major + mode is eq to the cons-cell's cdr (this is deprecated and will + result in a warning if used). * `not': the cdr is interpreted as a negation of a condition. * `and': the cdr is a list of recursive conditions, that all have to be met. @@ -1285,10 +1290,13 @@ project--buffer-check (string-match-p c (buffer-name buf))) ((symbolp c) (funcall c buf)) - ((eq (car-safe c) 'major-mode) - (eq (buffer-local-value 'major-mode buf) - (cdr c))) ((eq (car-safe c) 'derived-mode) + (warn "The use of `derived-mode' in \ +`project--buffer-check' is deprecated.") + (provided-mode-derived-p + (buffer-local-value 'major-mode buf) + (cdr c))) + ((eq (car-safe c) 'major-mode) (provided-mode-derived-p (buffer-local-value 'major-mode buf) (cdr c))) -- 2.34.0 --=-=-=-- From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Apr 2022 06:56:02 +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 To: Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165000576111082 (code B ref 54296); Fri, 15 Apr 2022 06:56:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Apr 2022 06:56:01 +0000 Received: from localhost ([127.0.0.1]:57992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfFs8-0002sg-QT for submit@debbugs.gnu.org; Fri, 15 Apr 2022 02:56:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfFs6-0002sN-H8 for 54296@debbugs.gnu.org; Fri, 15 Apr 2022 02:55:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfFs1-0002gi-4D; Fri, 15 Apr 2022 02:55:53 -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=+ZtnykxRcXyPumPX2Oaqdak4LfI478fWVFfv9UCiEco=; b=llrDXPqs1mPv xz1KKEP2sKhriYjwqFoDK+LVOFiTBqkeT0D3E4W/8zFcunw8X3CwPM7Q2vjmgmAkJJOqo1XNupvYj jqEmMv3Bu3cvQoMacOpq5Kp68N0j16QxBX7A9HfsItWEgCigBFMVvpz1Mg3gpLTHFWfyb7PAlu5NB 5amtxZkjtNDIVFOmh4WrwccPcUD3p7R+raYqDaFYRu2Ffhirpo1MyGzEJ0X2qgR+23DA6/3sLaxkk 8dXaIk8Vb5fM3eaVCWzBu4GQAep15Xg61ipbg9Aj3e7gcVsIpS1Xw4ey95p+vVsREsOJ0U70e4Yzm ZqqEFfdkjtiIQIhbrNCA5g==; Received: from [87.69.77.57] (port=1977 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 1nfFs0-0002IH-Kw; Fri, 15 Apr 2022 02:55:52 -0400 Date: Fri, 15 Apr 2022 09:56:04 +0300 Message-Id: <83bkx23ke3.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87a6co5aw9.fsf@posteo.net> (message from Philip Kaludercic on Thu, 14 Apr 2022 08:25:58 +0000) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87a6co5aw9.fsf@posteo.net> X-Spam-Score: -2.3 (--) 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 (---) > From: Philip Kaludercic > Cc: larsi@gnus.org, 54296@debbugs.gnu.org > Date: Thu, 14 Apr 2022 08:25:58 +0000 > > >> > I suggested to "clarify" that by not providing the 'major-mode' > >> > predicate at all. I still don't think I understand why it is so > >> > important that we should provide a special case for it. > >> > >> It is not inherently important, it is just that if the predicate would > >> also be used in project.el, then compatibility would have to be broken, > >> as the distinction between `major-mode' and `derived-mode' exists there. > > > > Then project.el could use the predicate route, right? It's quite a > > special case, AFAIU, so having a special solution is OK. > > I have updated the commits as you recommended, and add a commit > deprecating the use of `derived-mode' in project.el. Thanks, LGTM. From unknown Thu Jun 19 14:04:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philip Kaludercic Subject: bug#54296: closed (Re: bug#54296: Add buffer-matching functionality) Message-ID: References: <875yna398h.fsf@posteo.net> <87ee3d4cli.fsf@posteo.net> X-Gnu-PR-Message: they-closed 54296 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 54296@debbugs.gnu.org Date: Fri, 15 Apr 2022 10:58:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1650020282-30707-1" This is a multi-part message in MIME format... ------------=_1650020282-30707-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #54296: Add buffer-matching functionality which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 54296@debbugs.gnu.org. --=20 54296: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54296 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1650020282-30707-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 54296-done) by debbugs.gnu.org; 15 Apr 2022 10:57:12 +0000 Received: from localhost ([127.0.0.1]:58188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfJdX-0007y0-Uu for submit@debbugs.gnu.org; Fri, 15 Apr 2022 06:57:12 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfJdW-0007xm-Ef for 54296-done@debbugs.gnu.org; Fri, 15 Apr 2022 06:57:10 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 72DF0240107 for <54296-done@debbugs.gnu.org>; Fri, 15 Apr 2022 12:57:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1650020224; bh=riJ8aJGOr14T0lTVa3rjUMbQk5Vw2bm1z7k2UY4EArY=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Okc6O1EDpMU2YTsoSpoKlcefnNLh7HkEF7o24wjm54m+cxo2cvAsdXLM0i3cxTxON z1lChrpkHhjii5j0Fu8VXVT8LEzeGxmb3Ja1dwfX4AO4Zhe79R5WRW0VvMarUzvmuD pkaOhnVZ0xGKSn+wQ+7kgbDtEaxh4H7g0ekdSOEV/feBf7j0KGWBZjcSOQyjZIRfbe lDRh9Ea88skLeFZ1plG0eejLGdgkuksBV6BwNDXjXfGWcryZsF6bfJP7UguQC3ID8r HnyiX9feUG8bPUNP7F8n7y0een3utmuU3W3MA33QRtuXhJXmdaO17h8/hc3YS97742 10hSaQiAJzPmg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KftZ74G4tz9rxM; Fri, 15 Apr 2022 12:57:03 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#54296: Add buffer-matching functionality References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87a6co5aw9.fsf@posteo.net> <83bkx23ke3.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: Fri, 15 Apr 2022 10:57:02 +0000 In-Reply-To: <83bkx23ke3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Apr 2022 09:56:04 +0300") Message-ID: <875yna398h.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54296-done Cc: larsi@gnus.org, 54296-done@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 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: larsi@gnus.org, 54296@debbugs.gnu.org >> Date: Thu, 14 Apr 2022 08:25:58 +0000 >> >> >> > I suggested to "clarify" that by not providing the 'major-mode' >> >> > predicate at all. I still don't think I understand why it is so >> >> > important that we should provide a special case for it. >> >> >> >> It is not inherently important, it is just that if the predicate would >> >> also be used in project.el, then compatibility would have to be broken, >> >> as the distinction between `major-mode' and `derived-mode' exists there. >> > >> > Then project.el could use the predicate route, right? It's quite a >> > special case, AFAIU, so having a special solution is OK. >> >> I have updated the commits as you recommended, and add a commit >> deprecating the use of `derived-mode' in project.el. > > Thanks, LGTM. Great! The commits have been pushed. -- Philip Kaludercic ------------=_1650020282-30707-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Mar 2022 22:33:42 +0000 Received: from localhost ([127.0.0.1]:54806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRLvC-0006ko-3Q for submit@debbugs.gnu.org; Mon, 07 Mar 2022 17:33:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:33776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRLvA-0006kf-FE for submit@debbugs.gnu.org; Mon, 07 Mar 2022 17:33:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRLvA-0002O8-2c for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 17:33:40 -0500 Received: from mout02.posteo.de ([185.67.36.66]:49891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRLv7-0003jO-FP for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 17:33:39 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8441C240103 for ; Mon, 7 Mar 2022 23:33:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1646692415; bh=6Ok2SGWJi4yNthyZSGYC4kbdoXJ/ksCA1pEwBc54f50=; h=From:To:Subject:Autocrypt:Date:From; b=VchmMhKyx/lF2uIwGs85rb75anZIKclXNcj3RXwG8LJdEvOeIho/mdnFVSN9vxbhv iIXANPMtbFljRYLrQgEwHXcvwzjrjC9vvANfqS/qqcogukm1I9vFDkH0eSSDSlpsvn /oByMMYEv1asmIb76hRcAWZSdfcXisv3VIr7VuUkoo3jmRTd0q5jgAnpl7CqecFnzD znijSbRuFoih8B8T30vfP0NnvBKJtSqclanHIa1OGDw211PY/xvLRB8oWzZkxgF6X+ H75jxbyRlRj7PrijtXfQGtLgaPP1z3azG6l2aWQOUJhEtnHCw2SJB5V96YoOi62KdC 8SU5I15MGwg1Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KCCsp74vQz9rxD for ; Mon, 7 Mar 2022 23:33:34 +0100 (CET) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: Add buffer-matching functionality 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: Mon, 07 Mar 2022 22:33:29 +0000 Message-ID: <87ee3d4cli.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 (--) --=-=-= Content-Type: text/plain Tags: patch Project.el currently has a small language for matching buffers, used by project-kill-buffers and project--read-project-buffer. As mentioned in [0], this could be generalised, as done in the patch below. As to what file this should be added to, should be discussed. Either way I would consider these functions useful and would have wanted to use them in my own code many times before. While difficult, it might also be useful for things like display-buffer-alist (the issue is that a function as a condition in display-buffer-alist has to accept two arguments, while the proposed patch only takes one). To match functions such as string-match, the argument of buffer-match could be reversed so that the function can be used as a testfn to assoc/alist-get. The reason this was not immediately done when project-kill-buffers was implemented, was that this would raise the "emacs" dependency of the ELPA package "project" to the latest release or even the current development version. To solve issues like these, I have been working on "compat", a yet-unreleased library added to GNU ELPA a while back that could be added as a dependency to project. That way newer functions, such as the ones propose below could be used, without breaking ELPA compatibility. To make this work properly in the near future, compat would have to follow the upstream development, before a release is made. If there is any interest in this kind of an arrangement, I could start a thread on emacs-devel to discuss the details. [0] https://mail.gnu.org/archive/html/emacs-devel/2020-09/msg00082.html [1] https://elpa.gnu.org/devel/compat.html In GNU Emacs 29.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-02-24 built on viero Repository revision: bd17fa2c7565f180cedbfa396c0b159e144178cb Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Generalise-buffer-matching-from-project.el.patch >From f268509ba1b617b65851231c5ae262f3b169cd6c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 7 Mar 2022 20:49:42 +0100 Subject: [PATCH] Generalise buffer matching from project.el * subr.el (buffer-match): Add function to check if a buffer satisfies a condition. (match-buffers): Returns all buffers that satisfy a condition. --- lisp/subr.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index eb9af0b36d..1d0c9cf967 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6613,4 +6613,63 @@ delete-line (forward-line 1) (point)))) +(defun buffer-match (buffer condition) + "Return non-nil if BUFFER matches CONDITION. +CONDITION is is either: +- a regular expression, to match a buffer name, +- a predicate function that takes a buffer object as argument + and returns non-nil if the buffer should be killed, +- a cons-cell, where the car describes how to interpret the cdr. + The car can be one of the following: + * `major-mode': the buffer is killed if the buffer's major + mode is eq to the cons-cell's cdr + * `derived-mode': the buffer is killed if the buffer's major + mode is derived from the major mode denoted by the cons-cell's + cdr + * `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. + * `or': the cdr is a list of recursive condition, of which at + least one has to be met." + (letrec + ((match + (lambda (conditions) + (catch 'match + (dolist (condition conditions) + (when (cond + ((stringp condition) + (string-match-p condition (buffer-name buffer))) + ((symbolp condition) + (funcall condition buffer)) + ((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 conditions) + (unless (funcall match c) + (throw 'fail nil))) + t))) + (throw 'match t))))))) + (funcall match (list condition)))) + +(defun match-buffers (condition &optional buffers) + "Return a list of buffers that match CONDITION. +See `buffer-match' for details on CONDITION. By default all +buffers are checked, this can be restricted by passing an +optional argument BUFFERS, set to a list of buffers to check." + (let (bufs) + (dolist (buf (or buffers (buffer-list))) + (when (buffer-match buf condition) + (push buf bufs))) + bufs)) + ;;; subr.el ends here -- 2.34.0 --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=-- ------------=_1650020282-30707-1-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 12 20:26:49 2022 Received: (at control) by debbugs.gnu.org; 13 Jun 2022 00:26:49 +0000 Received: from localhost ([127.0.0.1]:56735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0Xur-00027o-E2 for submit@debbugs.gnu.org; Sun, 12 Jun 2022 20:26:49 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:42560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0Xuq-00027b-0K for control@debbugs.gnu.org; Sun, 12 Jun 2022 20:26:48 -0400 Received: by mail-wm1-f52.google.com with SMTP id l126-20020a1c2584000000b0039c1a10507fso2230035wml.1 for ; Sun, 12 Jun 2022 17:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:to:content-language :from:subject:content-transfer-encoding; bh=0owvnPKJlSIxl+alv+2XKk1sADwkfvLsvfhnebUqFWo=; b=NF+91br6KEvIU3yN5c31drreI9JvmdQX9b3eWcEhu74S4YeXeWz5M74Zqr3ciB07rc RCew9cL5mOHEpYIzhJ2d9JqQ4WbCN9qT45wzuQU2ZUln5l2etmH7qKba2QroyJPbroHK mgReaoYhZlDIZ601odHh8gDNlBEU0Jco27TUDbzFihLfu5vWzdH+r3daufjnOkl8sHgb MsYpJPvpgIRRElKUG4IlCRpRnsm8rclgXjND/TB/shhyA5lw+cFrRwnKtaeaO9uyTcb3 agyhPNOxWWcYRopGQh9FbgNTSm6en1O1LW22+Iik/Zn2zxlnnccDJK4f2kPHabkG4bcb 27+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :to:content-language:from:subject:content-transfer-encoding; bh=0owvnPKJlSIxl+alv+2XKk1sADwkfvLsvfhnebUqFWo=; b=xf+8i7CtYGYcAwCdJVYSD7I/K8Lq62GTHALEpAXbIT4dV1Jii9ga1tl+py4z8des2r vXgZHMb9hxwXvHhszVQYSDhPyklcUIlY0X6NXyAK5bWMh/kmyY9BnAt3b8lZk2b0bxdq XSkh29ozUkipwL2T6xJ++/32oLOmSzjkWq3vSKK+9tGib/gguXMJagw+UoPsMkhm+TeQ V97oF5aUlTEbVnkq7/qoZ6rqawnqq+WmwJo1f+DiAhDyCwyQLMSZdyorYi/h714jnkox JTNPDZCS6gxKrie1MEJgLmIEB6cP/Zworw1nUaBTaHoOEoNHqrMU2RqCxDv6eelBOmvH qYOw== X-Gm-Message-State: AOAM5327OgxsYq88kXFCYY8GdRmMxD+HDsyNYXZ5Eu+iS4As938ZHlBY ePq3OE1v1id/FlMdP3kuVzcV/drwC90= X-Google-Smtp-Source: ABdhPJycJcVxEH0kvuETDKR5L5hcc1hW7cZ3wuwN6tJ8CZWy9yViSh4YBHH5YEZ0Tyfn5gCEjJymQQ== X-Received: by 2002:a05:600c:4010:b0:39c:481c:c5bd with SMTP id i16-20020a05600c401000b0039c481cc5bdmr11623282wmm.139.1655080002294; Sun, 12 Jun 2022 17:26:42 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id h206-20020a1c21d7000000b0039746638d6esm7383836wmh.33.2022.06.12.17.26.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Jun 2022 17:26:41 -0700 (PDT) Message-ID: <6806fb80-7e6d-3230-fa4f-7553e11dccca@yandex.ru> Date: Mon, 13 Jun 2022 03:26:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 To: control@debbugs.gnu.org Content-Language: en-US From: Dmitry Gutov Subject: unarchive 54296 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: control 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: -0.5 (/) unarchive 54296 unarchive 54296 unarchive 54296 unarchive 54296 unarchive 54296 unarchive 54296 From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2022 00:31:02 +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 To: Philip Kaludercic , Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165508023110306 (code B ref 54296); Mon, 13 Jun 2022 00:31:02 +0000 Received: (at 54296) by debbugs.gnu.org; 13 Jun 2022 00:30:31 +0000 Received: from localhost ([127.0.0.1]:56741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0XyQ-0002fw-SI for submit@debbugs.gnu.org; Sun, 12 Jun 2022 20:30:31 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:43906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0XyO-0002YS-Gu for 54296@debbugs.gnu.org; Sun, 12 Jun 2022 20:30:29 -0400 Received: by mail-wr1-f54.google.com with SMTP id m24so5179740wrb.10 for <54296@debbugs.gnu.org>; Sun, 12 Jun 2022 17:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=xc8BFcbeBa1RNCOtYX93CwAl5mzEfsvTusatW4pcldE=; b=aPh0l7mQ3YeX4Lil/t8FPYjJam3QGAvht7REMTy+tpdvfE1GNqA+VND4umqZuDoDVV DpPpGShi8v+/VCymu02DQwSKRjt7sDUPE3gtAM0c/pr6hpTXrOOSOywOBn0kvsOvIvlo /opty9dSopQVLoyDXXRwATfDNA99icKzF6oBZXYxQih09SvAxG/+p/Ha0HNTJzyjRcog IyP0WcLoeyBDFUJ3CXOxbSpQkPXqjpijfpAAANCTDceajMhcyqJAkXEXfcjidJJMR7js KXKzhCLoN5RKxJiarhOtf8s+mvIf6aWdZV9F5re689gPwBU2fAK65D3XKBNDFOMNgEFt l2JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :from:subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=xc8BFcbeBa1RNCOtYX93CwAl5mzEfsvTusatW4pcldE=; b=vUQcPtdw75rj+bC1U70sUs/mmmgVTme/e/jyYLLGytuWIDlyCDVaYlYljlIWUcf08z mrnJNyicM4viDbyJSalSVCXXwQ9feWP6zL6nRaMCjUTwqwf77cg1VL2AAt5pNf410Vg9 nRxpml2jKM/7qIiLS6H5wXgoT5xp+rBNwgb4XdZCFMQ+hMO9r6oAp7DU0oPTiiR6/wiD m3XcGB+aXuEbfpNglTT12NdAnew3Yje3r8iLlI/ghb/BwzOpRu3d/W74R2BY86aDhXbG 6BWULPZ0OsdwlLP0AqOW6duugWGJTpm1OnH+kRjo1W18MCEnEaGeG56LCQpzfa3ndUu3 6vkw== X-Gm-Message-State: AOAM532crSEGazGRpIh4V8p2p64m1ItjTnJTYhi+asKBz4qMhBmR9mpl 3HpC0rvAqN1uwmpf1hmYtR8= X-Google-Smtp-Source: ABdhPJzrtTPzp53M/58Z/5l8RcQkH4ONtwIbNQxwmYyRi86EifAmy2qxGZcggnu/bxvGREgDOm7AEw== X-Received: by 2002:a05:6000:170e:b0:218:3fe0:7c72 with SMTP id n14-20020a056000170e00b002183fe07c72mr37875860wrc.572.1655080222708; Sun, 12 Jun 2022 17:30:22 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p190-20020a1c29c7000000b00397402ae674sm11314334wmp.11.2022.06.12.17.30.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Jun 2022 17:30:22 -0700 (PDT) Message-ID: <6f6e5142-5cfa-bdd0-e7d2-bb84c6aaabd3@yandex.ru> Date: Mon, 13 Jun 2022 03:30:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: Dmitry Gutov References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> Content-Language: en-US In-Reply-To: <87sfrk3b86.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 14.03.2022 15:38, Philip Kaludercic wrote: > The issue isn't that the default value couldn't be updated, but that if > anyone has e.g. been using `project-kill-buffer-conditions' over the > last 1½ years and has relied on the specific distinction between > `major-mode' and `derived-mode', they would run in to unexpected > results, that might result in more buffers being killed than intended, > potentially data being lost that the user might not expect because of an > update. I see that this point hasn't been addressed at all. Eli? From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2022 00:31:02 +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 To: Eli Zaretskii , Philip Kaludercic Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165508023510608 (code B ref 54296); Mon, 13 Jun 2022 00:31:02 +0000 Received: (at 54296) by debbugs.gnu.org; 13 Jun 2022 00:30:35 +0000 Received: from localhost ([127.0.0.1]:56744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0XyV-0002kn-29 for submit@debbugs.gnu.org; Sun, 12 Jun 2022 20:30:35 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:37807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0XyT-0002dL-Eo for 54296@debbugs.gnu.org; Sun, 12 Jun 2022 20:30:33 -0400 Received: by mail-wm1-f53.google.com with SMTP id o37-20020a05600c512500b0039c4ba4c64dso3732050wms.2 for <54296@debbugs.gnu.org>; Sun, 12 Jun 2022 17:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=A5nmuAjyxdx9NwNn4DEngujzl5LyuzHFt16U12zOSB0=; b=O9XzVyCBIslS5rlwYsZiWI0nxxOtXJ1MLPG0ZDG4lURdx+Obdbs90YmrXBAbOUGTqx 5tR2yDs3yi/PHD6k1SC4C7CK+2yk3GoG80jTwfkfcHm3Ny29y3StWOuUmJmFvcuHsWWl EubAQ23eKoKU6cA8FewP4CSJ7KJQUV+Y/sCLBRFWnqYGi2FM4nezkHUH6Tc2BBsgIHKF 4ygCputi4V/vfa4HsPMiP1fIJ/K5LqDNevRJLuMmnYsxW95RBu8BQD0mequohX+cNect jyVGJNqiU+bJdDy0vtycflNFgCfZ5z8vL6XEW4CG9Q2APkwI7kmMWbsZGbKkiZyf4CDd onMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :from:subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=A5nmuAjyxdx9NwNn4DEngujzl5LyuzHFt16U12zOSB0=; b=2aEdVMFNorXiI20XJ5JlMvHfaKwhGlPK8tR3auOkgXJVXrpW5b+cfgvHhzTdqoEU9y Qsbqd1Y0zD6IVSXjN//dVlyujJpyivf5R/Us4HbxUDs5jrPnltT5BHAyh/emEGlYOts/ 8Owkh48IV2tKRr5fwXMFXr/qf1tsMVFj1lqR2yD4KwTCtvB759JW8UoJmdhUp6SSdp6t +Akl5yePHCb1EgvyGgnAYewMMNOTzuxZ/K/aZhcRKYUET97KOLtEKXzWLpybElLkqgo6 8ofH9ueUsBVMO6/9vFOhX35sCjtNYsA3vpt36IzNx5Q9z6TlJGVSfGa+ti2vbi9DqoX0 GQUA== X-Gm-Message-State: AOAM530kZ77cCjsigNoXM3qslBjKeXmdWpQrMkHnvvoSECjDs8g48EGo VM3Dp1i1F1e7wUEoJQJqqlpmgJ58y6A= X-Google-Smtp-Source: ABdhPJzG1QrFlF2rFnpm+fCAzi2VbRF28XU8wIaUNNJDVjQAelYi5bLIkKwpDHH1KYabFQCbAdv3+Q== X-Received: by 2002:a05:600c:4ca7:b0:39c:422a:fc6f with SMTP id g39-20020a05600c4ca700b0039c422afc6fmr11878664wmp.55.1655080227777; Sun, 12 Jun 2022 17:30:27 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id m5-20020a056000008500b00213d75491b0sm6812577wrx.48.2022.06.12.17.30.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Jun 2022 17:30:27 -0700 (PDT) Message-ID: <5d3745d0-f658-7084-1a6f-f56a6f3f2c60@yandex.ru> Date: Mon, 13 Jun 2022 03:30:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: Dmitry Gutov References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> Content-Language: en-US In-Reply-To: <83czipkylw.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 14.03.2022 05:21, Eli Zaretskii wrote: > I still don't think I understand why it is so > important that we should provide a special case for it. It's pretty valuable to be able to provide a default value of project-kill-buffer-conditions which can be read at a glance (including in compiled Emacs) and easily edited via customize-variable by a user with little to no knowledge of Elisp. And 'major-mode' was used twice inside project-kill-buffer-conditions, not just once. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2022 12:06:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165512192615039 (code B ref 54296); Mon, 13 Jun 2022 12:06:02 +0000 Received: (at 54296) by debbugs.gnu.org; 13 Jun 2022 12:05:26 +0000 Received: from localhost ([127.0.0.1]:57420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0iou-0003uS-MZ for submit@debbugs.gnu.org; Mon, 13 Jun 2022 08:05:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0ioq-0003uC-Af for 54296@debbugs.gnu.org; Mon, 13 Jun 2022 08:05:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0iok-0006O4-MA; Mon, 13 Jun 2022 08:05:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=cGgzWMtLYuig2ZFmrBKSKc/M3vIroiQ74jNajBTh9AU=; b=icqfJPwIp45VUARsFso+ Cdd633A0vxXlW/ZMORH5EBQKbpFHJTwTm7zKgrzuuik5o1SQoITBh3wccDihRe+cRlOjDdiB1euVJ yUcaN6YKvmNxSDF66beQZohGAb/U4c1DF9MxDVJHxa5EdsYSRX9swcG0YaixTSC7B3eLtaPCgiNH1 iDyywMvipzcKutSK2DFLbj8higaKpEsSUdCChKj4A2oJZez+F5y8EGk02hLh0wG8Y6AXPcit6MjpK 0P9jJwoVbmtZdo7Udq+PWnXlba1WYegFGjUFbyY8OuuCy8h8HyXE6Xdwoa+6LAVGJnv8OWOHrUWR9 dG2720SReDbE/g==; Received: from [87.69.77.57] (port=1449 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 1o0ioi-0001VY-8T; Mon, 13 Jun 2022 08:05:14 -0400 Date: Mon, 13 Jun 2022 15:04:58 +0300 Message-Id: <834k0ovket.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dmitry Gutov on Mon, 13 Jun 2022 03:21:13 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 (---) > Date: Mon, 13 Jun 2022 03:21:13 +0300 > Cc: 54296@debbugs.gnu.org, larsi@gnus.org > From: Dmitry Gutov > > On 14.03.2022 15:38, Philip Kaludercic wrote: > > The issue isn't that the default value couldn't be updated, but that if > > anyone has e.g. been using `project-kill-buffer-conditions' over the > > last 1½ years and has relied on the specific distinction between > > `major-mode' and `derived-mode', they would run in to unexpected > > results, that might result in more buffers being killed than intended, > > potentially data being lost that the user might not expect because of an > > update. > > I see that this point hasn't been addressed at all. > > Eli? Do you agree with Philip that deprecating or removing major-mode would be a problem for users of project-kill-buffer-conditions etc.? I kinda gave up because Philip felt extremely uneasy with dropping major-mode, leaving us with just derived-mode, but I still think we shouldn't encourage Lisp programs to use major-mode. So if you don't think it would be a problem, I'd be happier if we removed major-mode and used derived-mode instead. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2022 12:14:03 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165512242015849 (code B ref 54296); Mon, 13 Jun 2022 12:14:03 +0000 Received: (at 54296) by debbugs.gnu.org; 13 Jun 2022 12:13:40 +0000 Received: from localhost ([127.0.0.1]:57436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0iwu-00047Z-Gh for submit@debbugs.gnu.org; Mon, 13 Jun 2022 08:13:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0iwt-00047N-0S for 54296@debbugs.gnu.org; Mon, 13 Jun 2022 08:13:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0iwn-0007ui-Fo; Mon, 13 Jun 2022 08:13:33 -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=q7DbHqtGVrGPh319qTupFDnkcJqcX6W67+7gHTaELm8=; b=GIzDKVWun39M BfMmasXw3FkGnEKQOMqjMDTaVq0VIe5uzNxXRie7Z8JFASvWc2rWDuhaOgs+0YKeJtA70qd5aQ8aG KQ5LNQGVBZm9H6eWDRnPdTp4gFxDiBAapjTnH0fD1FGZuH6HDi3aRfgZ3sOSAiljM7QB1Bc1lm2e9 BytYchu8XEy9HBCadmr4jhWVp2mFy6OPx3uA7r2zbGzBtUyTvWCcGBBz91yBwuHGgpQKZ/wedurK7 bfFjzxHKkSbFB1ZnR+wKn8o+YLufUFGvPuujKb2h7aj2iWR2nPIXQWnSGuRKIyetBC5VMIyeN9cw2 mB5qdVmdnEL1bXTuI4BdTQ==; Received: from [87.69.77.57] (port=1956 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 1o0iwm-0001OW-G1; Mon, 13 Jun 2022 08:13:33 -0400 Date: Mon, 13 Jun 2022 15:13:18 +0300 Message-Id: <8335g8vk0x.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dmitry Gutov on Mon, 13 Jun 2022 03:23:47 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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 (---) > Date: Mon, 13 Jun 2022 03:23:47 +0300 > Cc: 54296@debbugs.gnu.org, larsi@gnus.org > From: Dmitry Gutov > > On 14.03.2022 05:21, Eli Zaretskii wrote: > > I still don't think I understand why it is so > > important that we should provide a special case for it. > > It's pretty valuable to be able to provide a default value of > project-kill-buffer-conditions which can be read at a glance (including > in compiled Emacs) and easily edited via customize-variable by a user > with little to no knowledge of Elisp. > > And 'major-mode' was used twice inside project-kill-buffer-conditions, > not just once. I think I lost context, so please bear with me. My "still don't think I understand" comment was about the need to support major-mode when apparently the _only_ user of that is fundamental-mode, where we cannot use derived-mode instead. If indeed fundamental-mode is the only case where major-mode is useful, I asked why not use a predicate that tests explicitly for that case. And if I understand your reasoning above, then doesn't (eq major-mode 'fundamental-mode) provide an easy default that can be read at a glance? Or what am I missing? From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 18:44:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165523223619323 (code B ref 54296); Tue, 14 Jun 2022 18:44:02 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Jun 2022 18:43:56 +0000 Received: from localhost ([127.0.0.1]:35742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1BW8-00051a-E6 for submit@debbugs.gnu.org; Tue, 14 Jun 2022 14:43:56 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:37495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1BW3-00051J-7k for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 14:43:54 -0400 Received: by mail-ed1-f49.google.com with SMTP id v19so12911974edd.4 for <54296@debbugs.gnu.org>; Tue, 14 Jun 2022 11:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=YbXpjp21A8iTHhfhZoTbAXerS5Uc86XV82Kn3zqQu2k=; b=QPMaGORyNWUMFqcoXrrHDvZ+qU5CUU9T/6YccE1zgF2aebXlZ6RJ9iKz9FB9KIT6Rz tQdDeDIohQtQDD3jIBuDLahOMELaiBUEEoXOGvbv0fj0i8GTJaPkcvLmPzQYj+3Y9P4U AA/fbEEmOBQp7dOFjjL8eLiR7UySwbCAxrHTBuW9NL7g5sOd0+CbC3l/Lvnw7yF/eVs8 byYom8x/F85Fkw6bsQbsDG6NLa5trPvKy6haGlK0W3h2erq7SUxN2kJtUGqDWupGQHcv p/36ppEGzZtjXCmj/Z/pGxWDyWTJuL9UER+8EyA1mxn1px0D3Sj5FnOpH1vgYLZdxQHb F4/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=YbXpjp21A8iTHhfhZoTbAXerS5Uc86XV82Kn3zqQu2k=; b=vGzMB0qcTMgmSROPSbymWsNkxvjDeKL4sudrJrEbb5V+gTT8y0w9+4VW4NSVr6G0rH C4+F+4WrsYexoEnPOKFU+Fz3KVJNJIPoAnAQJ1CgLWTIg8aeExhfQEEocaVzNp26XUHA oFix3cAg0EsaZo9Fsauf839K23/nYgwUBx4/yUc7bmStMiBCzbpmeV9SORFW2RNuSHvF KhI4Bjg76S7LUNLYklyDPYjvm2Pnum68jnKCJgwrNHWeUttfGr9pt1TIQoyuIXBL8OtJ zu+8jVThxlYyY05DttZVU5wxrdHcvmiugrPfYVFnVes4V/FaJpj6A0uKybCoRLN5Fdbr srRw== X-Gm-Message-State: AOAM532QQeicdz0MhSG81f/bKWx8hTpVdn07qfi0xtQGeZ2slKxJiUTo 9OMfFDx0xIcYeWH0TFtZ9GM= X-Google-Smtp-Source: ABdhPJwJktW35ww46dY8KgUB4F0uinMpNELOg8gceK7GKmZZQTRJsv8GN8TVv7YQ8zvXk6Y5fqj1vQ== X-Received: by 2002:a05:6402:4306:b0:430:6a11:da7d with SMTP id m6-20020a056402430600b004306a11da7dmr7809240edc.126.1655232225114; Tue, 14 Jun 2022 11:43:45 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id s13-20020a05640217cd00b0042dd85bd23bsm7584602edy.55.2022.06.14.11.43.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 11:43:44 -0700 (PDT) Message-ID: <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> Date: Tue, 14 Jun 2022 21:43:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <834k0ovket.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 13.06.2022 15:04, Eli Zaretskii wrote: >> Date: Mon, 13 Jun 2022 03:21:13 +0300 >> Cc: 54296@debbugs.gnu.org, larsi@gnus.org >> From: Dmitry Gutov >> >> On 14.03.2022 15:38, Philip Kaludercic wrote: >>> The issue isn't that the default value couldn't be updated, but that if >>> anyone has e.g. been using `project-kill-buffer-conditions' over the >>> last 1½ years and has relied on the specific distinction between >>> `major-mode' and `derived-mode', they would run in to unexpected >>> results, that might result in more buffers being killed than intended, >>> potentially data being lost that the user might not expect because of an >>> update. >> >> I see that this point hasn't been addressed at all. >> >> Eli? > > Do you agree with Philip that deprecating or removing major-mode would > be a problem for users of project-kill-buffer-conditions etc.? Yes. I also mentioned that here: https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00650.html Not for all users, only for some of those who customized the value, etc... but we're usually more concerned about backward compatibility than the present development seems to have indicated. If we can argue over several days (or weeks?) about removing a key binding that nobody uses, changing DSL in an incompatible way has to be considered a problem. > I kinda gave up because Philip felt extremely uneasy with dropping > major-mode, leaving us with just derived-mode, but I still think we > shouldn't encourage Lisp programs to use major-mode. So if you don't > think it would be a problem, I'd be happier if we removed major-mode > and used derived-mode instead. If I didn't think Philip's point had merit, I wouldn't have brought it up now. The idea of discouraging the (eq major-mode ...) semantics (instead of derived-mode-p) has merit, but so far we have one complex prior art for this functionality, and it did find a use for this distinction. Two uses, to be exact. Another example where we might migrate to buffer-matches-p is 'turn-on-font-lock-if-desired'. And that one also currently uses (memq major-mode font-lock-global-modes) rather than derived-mode-p. There probably are reasons for this as well. We could try some methods that discourage the use of 'major-mode' as opposed to 'derived-mode'. Maybe by calling them 'major-mode-eq' and 'major-mode' (where the longer version feels more awkward and thus less desirable). But FWIW I like the current couple of 'derived-mode' and 'major-mode' because it feels "transparent" for an experienced Elisp programmer. Rather than having one guess that 'major-mode' uses the derived-mode-p predicate or search for that info in the docs. And if we change the keywords in project-kill-buffer-conditions, I suppose it will require some migration strategy. Which is going to be a pain. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 18:49:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165523249620018 (code B ref 54296); Tue, 14 Jun 2022 18:49:02 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Jun 2022 18:48:16 +0000 Received: from localhost ([127.0.0.1]:35764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1BaK-0005Co-6F for submit@debbugs.gnu.org; Tue, 14 Jun 2022 14:48:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1BaI-0005CO-L0 for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 14:48:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1BaC-0003lF-No; Tue, 14 Jun 2022 14:48:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=l01iQvncI4pfdoJTcyA4nMMO3Bfbm6pEPPPDDDI/SMc=; b=XD4qlFkecNu36OWV/mln 0CZF7f0fLwgh9SUW3RYYBMv3BVlket0d9XMse9vbTTMy/dlxgIxFzODFXFhu6SuHfhPZPAKfCmQSi MK3b0uUUsg1+0BXLM+kSV7p7tx0NAvfEa5pWjTRkVN86GWdJHDV9E9j/gA3fhbKCnI9kzBswH2O7Z sztisnIWvwyXyPPU7Qc3s9iCwRnsoPLc0mFxB+Vpvj9C3WKyrqR15toBn5oOL/0adRNVHL1fi3k2n jBuScykELlL8H1wRXfusZxjADt+mYMRMnwWxE6ORUuz2XiDXuOzBDq2DnL6yVRn/5e/9tR34cMYkH 0qojLki3fOj7nA==; Received: from [87.69.77.57] (port=2825 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 1o1Ba8-0001r2-07; Tue, 14 Jun 2022 14:48:08 -0400 Date: Tue, 14 Jun 2022 21:47:53 +0300 Message-Id: <83pmjbrsiu.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> (message from Dmitry Gutov on Tue, 14 Jun 2022 21:43:41 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 (---) > Date: Tue, 14 Jun 2022 21:43:41 +0300 > Cc: philipk@posteo.net, 54296@debbugs.gnu.org, larsi@gnus.org > From: Dmitry Gutov > > On 13.06.2022 15:04, Eli Zaretskii wrote: > >> Date: Mon, 13 Jun 2022 03:21:13 +0300 > >> Cc: 54296@debbugs.gnu.org, larsi@gnus.org > >> From: Dmitry Gutov > >> > >> On 14.03.2022 15:38, Philip Kaludercic wrote: > >>> The issue isn't that the default value couldn't be updated, but that if > >>> anyone has e.g. been using `project-kill-buffer-conditions' over the > >>> last 1½ years and has relied on the specific distinction between > >>> `major-mode' and `derived-mode', they would run in to unexpected > >>> results, that might result in more buffers being killed than intended, > >>> potentially data being lost that the user might not expect because of an > >>> update. > >> > >> I see that this point hasn't been addressed at all. > >> > >> Eli? > > > > Do you agree with Philip that deprecating or removing major-mode would > > be a problem for users of project-kill-buffer-conditions etc.? > > Yes. I also mentioned that here: > https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00650.html So then everything is okay, AFAIU, because eventually Philip left that in the code. Right? > > I kinda gave up because Philip felt extremely uneasy with dropping > > major-mode, leaving us with just derived-mode, but I still think we > > shouldn't encourage Lisp programs to use major-mode. So if you don't > > think it would be a problem, I'd be happier if we removed major-mode > > and used derived-mode instead. > > If I didn't think Philip's point had merit, I wouldn't have brought it > up now. OK, but I didn't press my POV, so where's the problem, and why the emotions? From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 19:01:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165523323123098 (code B ref 54296); Tue, 14 Jun 2022 19:01:02 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Jun 2022 19:00:31 +0000 Received: from localhost ([127.0.0.1]:35800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1BmA-00060B-P7 for submit@debbugs.gnu.org; Tue, 14 Jun 2022 15:00:30 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:33338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1Bm9-0005sl-3y for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 15:00:29 -0400 Received: by mail-ed1-f49.google.com with SMTP id eo8so4739603edb.0 for <54296@debbugs.gnu.org>; Tue, 14 Jun 2022 12:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=NbqcMfwLmdQCsvamDQ8YPKgboWGskwoVZegcH4t/Zcs=; b=DXoprWkvTGCY9LMnr+Y4vbqzmSFoEQi48W3uFEEv7eGteMDAVJXTQL3kucCAYuzPfe 4LQYr3FASTxuwbT6Y9IoKoOWHx8llq1+I5LKXy2XknwJQXnM9tYAju4AXzc0GKclmoSH Mh2q0WBDexh2FDKDQVlGRINT43YiXVE6227MELvO8SESAyiYz2+AV/Cd1mrgpsYRVwgG aOr5JLC88S3Omr6fqKjN7VC+f75IxRBVkDfVot2qcCPOBok2pR7pBrwAjlMLkBH9LHj/ l6Z4+YZ9UeQqAgyUSO9vNn/9gzALoLI31MwcRQxlSVEMN9Kd2hTVKbEcxGIv+zH4pp2E DISw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=NbqcMfwLmdQCsvamDQ8YPKgboWGskwoVZegcH4t/Zcs=; b=u/PpRt3SbJSrIk5VayHOjeqJSDiafCksYlZNr6wH3UGiD+oXg52HK2xShY8ARnIU6Q QbvAKS2ZauQuN7YVyp4Zdi7zTT4ZWddP1irY5L3YlXchMODQkENO/iOsY7H97pYuHxnz 4YK2yHdf3wzMq2GDOz+g0qbf5MlfNkm5rPpAd3QgiCjICY/dtSvoHvDnUukroJ2HrCxy GRR1nwLL6wxdrnAnVz38ZBXoaZwvkcCEe746R39vvlLgrz4DkffMEhVqO8hLYPn2kwfF Uk7Ncs576h0CKzF+iBf/31NXLrQmBW0LQInTG4CTEU5Ely7GpOf62XpIocKm6L/w+nrc KsYA== X-Gm-Message-State: AOAM530egmvsyz97emcocK6y9YIm1ZloYC1hAw4hMX2t4N1JrlwueCcf kBHTePHFjzY17vEoFM27Buk= X-Google-Smtp-Source: ABdhPJyw6b8m4uXJkRpLmK3G2wQ5E8V1PEUR+vxOmvlWA9paGVEvUKrbxbNhPS3+/9hc+QYWYJ9Kkg== X-Received: by 2002:a05:6402:2806:b0:431:87c8:b45e with SMTP id h6-20020a056402280600b0043187c8b45emr7903148ede.130.1655233223186; Tue, 14 Jun 2022 12:00:23 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id fl5-20020a1709072a8500b007052b183d51sm5337021ejc.132.2022.06.14.12.00.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 12:00:22 -0700 (PDT) Message-ID: <9e53bb47-9e20-2465-28e5-0e0a64d7ae44@yandex.ru> Date: Tue, 14 Jun 2022 22:00:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <8335g8vk0x.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <8335g8vk0x.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 13.06.2022 15:13, Eli Zaretskii wrote: > My "still don't think I understand" comment was about the need to > support major-mode when apparently the_only_ user of that is > fundamental-mode, where we cannot use derived-mode instead. There are two uses of it inside project-kill-buffer-conditions. One is (major-mode . fundamental-mode) , and another is (and (derived-mode . special-mode) (not (major-mode . help-mode))) I suppose in the latter it doesn't really matter whether the check uses 'derived-mode-p', but the current way is more conservative. Also see the turn-on-font-lock-if-desired example from the other email. > If indeed > fundamental-mode is the only case where major-mode is useful, I asked > why not use a predicate that tests explicitly for that case. If a predicate is a lambda, then it's not as readable. > And if I understand your reasoning above, then doesn't > > (eq major-mode 'fundamental-mode) > > provide an easy default that can be read at a glance? Are you proposing adding a "keyword" 'eq' which would have a variable name as its first arg and the value as its second arg? That would work (aside from the backward compatibility concerns). It might look confusing to a Lisp programmer, resembling "regular" code too much, creating false expectations. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 19:18: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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165523425631101 (code B ref 54296); Tue, 14 Jun 2022 19:18:01 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Jun 2022 19:17:36 +0000 Received: from localhost ([127.0.0.1]:35812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1C2i-00085Y-GU for submit@debbugs.gnu.org; Tue, 14 Jun 2022 15:17:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1C2g-00085M-CP for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 15:17:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1C2Z-0008Cc-S2; Tue, 14 Jun 2022 15:17:27 -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=EUb5IWGzrjR/HRsd6ohUk5SLwfmPAB2w1FqXb476ssI=; b=RhG8QOx4Hp4d vJuLBlwwgj2hEKvNr2rxa2IbHYD+n92g0LENhWeXgJ4hbD/VPz/0J5oSA5h+Bm2/VR5CQhBmJgCSC MYYKvTPYK1pzQ70GCYsxwj+DOmtPjrwb8OTt1zX69qI5YhL6tq9IXCHAAE/y83GDJYUIjFK8Yb+X/ IJz6z6AzhE7geBOaSAsab8nrLbqv3DwmtxfIxQetmmrFETZrSw4B/oA1qCfWWDYbtBp56fTDOkZ1W qvBMJKkozgB2sb8wXLfQtPozQbkuoGPO02Ca470vT6JeuQWUxK/9aLlQR+fg01G27yWAJeTn/Xpss UjUj2DH8Xbkfkx7duklyuQ==; Received: from [87.69.77.57] (port=4624 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 1o1C2Z-0002tb-BZ; Tue, 14 Jun 2022 15:17:27 -0400 Date: Tue, 14 Jun 2022 22:17:16 +0300 Message-Id: <83mtefrr5v.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <9e53bb47-9e20-2465-28e5-0e0a64d7ae44@yandex.ru> (message from Dmitry Gutov on Tue, 14 Jun 2022 22:00:20 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <8335g8vk0x.fsf@gnu.org> <9e53bb47-9e20-2465-28e5-0e0a64d7ae44@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Tue, 14 Jun 2022 22:00:20 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > > And if I understand your reasoning above, then doesn't > > > > (eq major-mode 'fundamental-mode) > > > > provide an easy default that can be read at a glance? > > Are you proposing adding a "keyword" 'eq' which would have a variable > name as its first arg and the value as its second arg? No, I proposed to use the "predicate function" method (which already exists). From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 19:38: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.1655235429661 (code B ref 54296); Tue, 14 Jun 2022 19:38:01 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Jun 2022 19:37:09 +0000 Received: from localhost ([127.0.0.1]:35843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1CLc-0000Ab-RT for submit@debbugs.gnu.org; Tue, 14 Jun 2022 15:37:09 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:44665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1CLY-00009q-Aq for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 15:37:08 -0400 Received: by mail-ed1-f42.google.com with SMTP id b8so13045067edj.11 for <54296@debbugs.gnu.org>; Tue, 14 Jun 2022 12:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GrQr/VtBq1TRSn+SwWnT7SICVDWmqmhPWgICnvRA/7A=; b=ccSoMDdPq2KR0aHGVOk5RpKGZK5nb+aaeZT9j8xrLEhc/a14Y5XOaoL+miit8DSMgO MoQoXC9piG7J/Y+EmlIY9DTbs6iH4vFFzA90/NdT+3G71bmf88zTILV++HDwNjFoscCf 5u9yctcOunS2wkUU+TbTTjn+9xlsxwPHlOZ3Z8hZjK5mxnChufnbQp5t89NuUXFXRdUZ /U80NYTnHTHN/D8E05M2O3zyOPpde9b+psTCrm2cUmUvcC9L3cwhD0qAbNsLfnmk2sAJ D52w66X4G8AGEqsX3mXb9WGGX6OrunDIlLnBBWAE/wK8qECYMtFSGB13C68rOarFLTMb LKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GrQr/VtBq1TRSn+SwWnT7SICVDWmqmhPWgICnvRA/7A=; b=gxkmMhuWmNW6AUZ79tJ+kG/XBWH4GSnM7qVygWuxAa8jDafdSN8Nns1xRjUcvZMzes 6gtJVjkgzVZ4dpe0D8cEHqTKD23Su9r2jIYSPmSpU0BHjicFsUWmjR0JBXxc/+PqoW4D RaZfuXAP71uceQfZExX1PyKAoKFu4pMTRjklwq/v89Y2cPe26W55qez36wJzUPMXPeVr RkXc7Acs0ZhuEKsJsX+CAkcJTbncq9IJTGh0nbbcsOIdTkM2fdt0Z9ORUq66js6P37mb LJRvczviRi1GaPbanJX34EQekxfBj8WxooZlRFmXTX7hCNXOr1eNUVGB2p990U0PyNR+ dbbA== X-Gm-Message-State: AOAM5328LYv5dGYgVRdzZJozLJEy+UcSivJktxGy6MEULj9unjoxM3Kx /9WekQA59G+y8VljDyADIlw= X-Google-Smtp-Source: ABdhPJy07yV6jK0zBlVyd+iyFnR5/aEBC9Z5e3tHKpQlg1y5Jy9s3+FcJQxiUKjipEevOB9RIC+i6Q== X-Received: by 2002:a05:6402:125a:b0:431:34c8:4805 with SMTP id l26-20020a056402125a00b0043134c84805mr8158425edw.314.1655235418265; Tue, 14 Jun 2022 12:36:58 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id u4-20020a170906408400b006fee16142b9sm5349038ejj.110.2022.06.14.12.36.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 12:36:57 -0700 (PDT) Message-ID: <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> Date: Tue, 14 Jun 2022 22:36:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83pmjbrsiu.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 14.06.2022 21:47, Eli Zaretskii wrote: >>> Do you agree with Philip that deprecating or removing major-mode would >>> be a problem for users of project-kill-buffer-conditions etc.? >> >> Yes. I also mentioned that here: >> https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00650.html > > So then everything is okay, AFAIU, because eventually Philip left that > in the code. Right? No, he didn't. He tried to migrate project-kill-buffer-conditions to the new format, with predicted unfortunate side-effects. And an unpredicted one (which is easier to fix, though). See commit 1a3bad431d. >>> I kinda gave up because Philip felt extremely uneasy with dropping >>> major-mode, leaving us with just derived-mode, but I still think we >>> shouldn't encourage Lisp programs to use major-mode. So if you don't >>> think it would be a problem, I'd be happier if we removed major-mode >>> and used derived-mode instead. >> >> If I didn't think Philip's point had merit, I wouldn't have brought it >> up now. > > OK, but I didn't press my POV, so where's the problem, and why the > emotions? Your POV was the one that got implemented. buffer-match-p has 'major-mode' but not 'derived-mode'. And 'major-mode' behaves like 'derived-mode' behaved in project-kill-buffer-conditions. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 19:47: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16552360191630 (code B ref 54296); Tue, 14 Jun 2022 19:47:01 +0000 Received: (at 54296) by debbugs.gnu.org; 14 Jun 2022 19:46:59 +0000 Received: from localhost ([127.0.0.1]:35865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1CV9-0000QE-HM for submit@debbugs.gnu.org; Tue, 14 Jun 2022 15:46:59 -0400 Received: from mail-ej1-f48.google.com ([209.85.218.48]:35801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1CV8-0000Q1-9I for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 15:46:59 -0400 Received: by mail-ej1-f48.google.com with SMTP id me5so19223360ejb.2 for <54296@debbugs.gnu.org>; Tue, 14 Jun 2022 12:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=p2oDzMt/gRKzRfx2dHehJBa9bcIvgfKL0hTBY5hAeL8=; b=oL9CDl9Rb5VD01CieqsNufbmjmbZz1v/bi+Hl7CUESLksG/TClYNF9Qtgg76vYIrPj PkanXj5azi/uBkM7ziWXeGwsiww6Ukl5zF3ioJ9A5jXpWaU3PEaLhyjj0wkouPB7bZwK K9+MgLKNYKnRzn5kw++qQHxtEVwvaOzV7lEWAMExpH/UJHYR9hSLDnU00TmxbCNdYct/ Hdkd0hRcaBj14OVnwgibZCzn7l3WT20rpIj/wmcPKjwYba5DOWvwu0hUZtghQj2++80B Q+N/mOqMYDcIlocyLBjm7QfY/YGQaL3FQnCe/+dZa5nzzpryEQWGQNTVjYjHk3itmMxv 2zQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=p2oDzMt/gRKzRfx2dHehJBa9bcIvgfKL0hTBY5hAeL8=; b=NObFP0VHSsWch1xlQBhqFFUVKWLt7n8WsZ1GB/bzcPV54l6+Hs5F/sq19CkXsbd0Hr BQcNIEg5BXpsyKqMhlRrkPpg4NNGoSCAW87RM9CU1U2fuKrIeiqGY05+Dy7kQdlaX0WE juOGE/TExstk2y826zhS53DUtmub73E5k8EZyIV2+M/l/jXOGbRMrLWRwdrxlOvLyBWD bd7y4m8evH+5faAv2XsY/X40XxnxPpx0fRb0u2n3wK9vBmUJOm+Jj4zhEsbhm4iZZ32C wb357DRyPEoQLmB251Df69FcA7aAx8DTddBshFeNUCwfQme4BUkHxVftxrQigeW7rw0F VFGA== X-Gm-Message-State: AOAM531cI2seGKV1b29hpfeDkFZAeFyAGsOYp38a+VQICMh8zoMP8Wlr 5pV9795+lmUj/Z5ZxxuI/20= X-Google-Smtp-Source: ABdhPJzITHVhlBUFZlBBOJlWtrSxhPyLLoWG4dpI+tcaNltmEyEGdStWc8+yutiE5KuWXDl4D0EgCg== X-Received: by 2002:a17:907:930:b0:711:da36:62f7 with SMTP id au16-20020a170907093000b00711da3662f7mr5835015ejc.468.1655236012343; Tue, 14 Jun 2022 12:46:52 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id vp12-20020a17090712cc00b006feec47dadfsm5389109ejb.156.2022.06.14.12.46.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 12:46:51 -0700 (PDT) Message-ID: <61d3ee65-325e-9da6-67cc-c0b0dade5dac@yandex.ru> Date: Tue, 14 Jun 2022 22:46:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <8335g8vk0x.fsf@gnu.org> <9e53bb47-9e20-2465-28e5-0e0a64d7ae44@yandex.ru> <83mtefrr5v.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83mtefrr5v.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 14.06.2022 22:17, Eli Zaretskii wrote: > No, I proposed to use the "predicate function" method (which already > exists). Then the downside is "it's not readable". Or editable, really. At this point you could say that we need to support lambas anyway (ok), and if people use them, we can use it for this purpose too. But it seems to me that, by not supporting lambdas so far, over the couple of years since its introduction, project-kill-buffer-conditions has kind of proven its minimal DSL to be viable. And if by having the 'major-mode eq' matcher we manage to avoid the use of lambdas in 99%+ use cases, then that's a win for usability. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 02:34: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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16552604118626 (code B ref 54296); Wed, 15 Jun 2022 02:34:01 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 02:33:31 +0000 Received: from localhost ([127.0.0.1]:36174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1IqZ-0002F3-2s for submit@debbugs.gnu.org; Tue, 14 Jun 2022 22:33:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1IqX-0002Eq-Hz for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 22:33:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1IqS-0003E9-2k; Tue, 14 Jun 2022 22:33:24 -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=hv9dZsp8U6N49xuly0XMpdIA9UK/RE8P1xPrUn6qz7A=; b=bpW5x6Eh4l8G Ukd1Ivnc1tn8fm271NkRs2e3Og1ihkuMh1o6Te9WgHeq7H1dtCOe8ogtU+QgWOfFzEakmqAHLkBWS /Vstsr/27tdxBiIqM2hn8RCJWsNa7ryK6mvntzvslmvkgis6+qoX91bsKZrzdkHeI82iJcODaDvE4 VIcOagFCFWAjC/XlsCqWXhIMrWdSqCbnU/1Twi9hjiyernxMu5KKcOt089hM4NeFqzvY62XbK1UuL zhbu7EB9NUcGO0Ik9HHPLDLD1m0vo2XTnxrEUiDz4R/1AIPtukQt3O/Aij5/YhU6KGe5Jhp6q3zdM 9HMvAPycLPE2Cmnpj32IWg==; Received: from [87.69.77.57] (port=3287 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 1o1IqR-0002yn-IP; Tue, 14 Jun 2022 22:33:23 -0400 Date: Wed, 15 Jun 2022 05:33:14 +0300 Message-Id: <83ilp2sljp.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> (message from Dmitry Gutov on Tue, 14 Jun 2022 22:36:55 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Tue, 14 Jun 2022 22:36:55 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > On 14.06.2022 21:47, Eli Zaretskii wrote: > > > So then everything is okay, AFAIU, because eventually Philip left that > > in the code. Right? > > No, he didn't. > > He tried to migrate project-kill-buffer-conditions to the new format, > with predicted unfortunate side-effects. And an unpredicted one (which > is easier to fix, though). > > See commit 1a3bad431d. Which part? AFAICT, major-mode is still in the code: (defun buffer-match-p (condition buffer-or-name &optional arg) "Return non-nil if BUFFER-OR-NAME matches CONDITION. CONDITION is either: - 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, - 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 derived from the major mode denoted by the cons-cell's cdr [...] ((eq (car-safe condition) 'major-mode) (provided-mode-derived-p (buffer-local-value 'major-mode buffer) (cdr condition))) > > OK, but I didn't press my POV, so where's the problem, and why the > > emotions? > > Your POV was the one that got implemented. buffer-match-p has > 'major-mode' but not 'derived-mode'. And 'major-mode' behaves like > 'derived-mode' behaved in project-kill-buffer-conditions. This seems to be some misunderstanding. I wanted us to have only 'derived-mode', not 'major-mode'. But Philip was unhappy about that, due to existing usage of 'major-mode', and eventually 'major-mode' was left in the code. Or at least this is my recollection of the discussion and its resolution. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 02:35:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16552604898748 (code B ref 54296); Wed, 15 Jun 2022 02:35:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 02:34:49 +0000 Received: from localhost ([127.0.0.1]:36179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1Irp-0002H2-H3 for submit@debbugs.gnu.org; Tue, 14 Jun 2022 22:34:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1Iro-0002Gn-5i for 54296@debbugs.gnu.org; Tue, 14 Jun 2022 22:34:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Iri-00045S-T7; Tue, 14 Jun 2022 22:34:42 -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=9vffGq6uCexDaie9Cv0JEeGuJQYqWXiF6A8xpGngYC0=; b=Omw80Dr/3vz/ ZCXa0weWh5lmEj2nNdlCOoXYeF8GDf2ZogsWEbn01PUzluH1N4JaF1cq/3vN9kvgbc7Q4tDFjm1w4 SDWcHdD2ga/zqiQW3g34yE5tMq0St5WeG3Vj79L9pYWp1mY5rDLVHcSPy0vqJmoRr4mLTne1SjXAp NF7OF0JFb5mRTXtXzheComCkzUntWQnDWziXbG4X6ea1/+bXb4BlkeratprGxR/F2JaqiEElrgUWa bg95mufaHvMkUxPDb1BqdtpHCTRTQwsOl5j3MqIlcbaksQhEVjJQOSWCiUsm2rH90IKsD3HqTX2rl Fs1lMJZWzH9fH4h1aLPWuA==; Received: from [87.69.77.57] (port=3368 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 1o1Iri-0004mv-CN; Tue, 14 Jun 2022 22:34:42 -0400 Date: Wed, 15 Jun 2022 05:34:33 +0300 Message-Id: <83h74mslhi.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <61d3ee65-325e-9da6-67cc-c0b0dade5dac@yandex.ru> (message from Dmitry Gutov on Tue, 14 Jun 2022 22:46:49 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <8335g8vk0x.fsf@gnu.org> <9e53bb47-9e20-2465-28e5-0e0a64d7ae44@yandex.ru> <83mtefrr5v.fsf@gnu.org> <61d3ee65-325e-9da6-67cc-c0b0dade5dac@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Tue, 14 Jun 2022 22:46:49 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > On 14.06.2022 22:17, Eli Zaretskii wrote: > > No, I proposed to use the "predicate function" method (which already > > exists). > > Then the downside is "it's not readable". Or editable, really. > > At this point you could say that we need to support lambas anyway (ok), > and if people use them, we can use it for this purpose too. > > But it seems to me that, by not supporting lambdas so far, over the > couple of years since its introduction, project-kill-buffer-conditions > has kind of proven its minimal DSL to be viable. > > And if by having the 'major-mode eq' matcher we manage to avoid the use > of lambdas in 99%+ use cases, then that's a win for usability. This is all a moot point, since eventually 'major-mode' was left in the code. Any of the suggestions I had for removing it are therefore purely academic at this point, nothing to argue about. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 11:50: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165529374526359 (code B ref 54296); Wed, 15 Jun 2022 11:50:01 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 11:49:05 +0000 Received: from localhost ([127.0.0.1]:36691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1RWC-0006r5-Qr for submit@debbugs.gnu.org; Wed, 15 Jun 2022 07:49:04 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:33567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1RWA-0006qb-Bu for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 07:49:03 -0400 Received: by mail-ej1-f44.google.com with SMTP id bg6so22822741ejb.0 for <54296@debbugs.gnu.org>; Wed, 15 Jun 2022 04:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=nkybLifd/A6LHPK1MGxNyW9Qd5p1MP0Z2DsskFGs6Ug=; b=LqhO/YwWKtk0roRVk33Uw9ZwIcQ0cj6jQciMVKYDOSmRCAhMdxRQS5BnWEHVyzg1A7 SgCyaNesuEhJibQTZEZhS+ngHVYEldylnjxRYJa6J2iJYoBKy8eenF72bGnictmcGhU7 cuCjBbwC878eRWc/FAeqpOMjecGqYWQx3aK/15Kql1igZZNWknUHf4FXRIe+63YL+IGg OC5R1nw6DCk7gZF+chZnMYi+Sr3U5AhGkXvTcwHwFEog+ShIU4oKiG2JAGOJrX4r/B/S TOvs6vQVsg8jk9C3T+RIEybf17kEm6eo7OazKmaQMFoqueedoM8LOJqXo5crFkHPkAst wrGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=nkybLifd/A6LHPK1MGxNyW9Qd5p1MP0Z2DsskFGs6Ug=; b=DuV0EQGfw1XjeaVUe0FhC9hBrU1jcidSor6isJYdOu19X2XxP3mxfONYPHlTlRFAsa 87qU+zo2v54dMR1v8S+iUlbOXuOQGjuC3krniHPggKuZJLK9u/BtASx4WSGCp44qm3Uc AU6HA2R9RAAckWaXNmXV5eBcD0fR8XGA4zeUwxXy5/DZ/mB7d4yz/CmX7XpVZmeqpiaa x+StrhYMAgpjF8zL39YLL0RGNExJYJ4wO4EWC1DcdQ7mf0EGYRW1ezORGS+j0UCKxGGl cumceYGC07hraDqGy4b+jNkMJ18xYm7MHrykW9oCFZM+B/L94GuPxhz91S2aCBldoqEu 2btw== X-Gm-Message-State: AJIora9Q9VuW0FzuU6yYfWMY/61ep7L15Zld66ewHW2upY1Z2eAYGDoC LVoQ83gAEhUWdjV0DQ5S6BI= X-Google-Smtp-Source: ABdhPJwIaHpgNroB/cbrXdyPLgBbeVusDXAGN9mnYl+Vv+MIfWCRnkszxXFejSEwuHHwvMmqrQzYkw== X-Received: by 2002:a17:906:535e:b0:712:ac3a:f0b0 with SMTP id j30-20020a170906535e00b00712ac3af0b0mr8608386ejo.316.1655293736216; Wed, 15 Jun 2022 04:48:56 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id e3-20020a50fb83000000b0042e309906desm8987164edq.58.2022.06.15.04.48.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 04:48:55 -0700 (PDT) Message-ID: Date: Wed, 15 Jun 2022 14:48:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83ilp2sljp.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 15.06.2022 05:33, Eli Zaretskii wrote: > This seems to be some misunderstanding. I wanted us to have only > 'derived-mode', not 'major-mode'. Okay?... > But Philip was unhappy about that, > due to existing usage of 'major-mode', and eventually 'major-mode' was > left in the code. Or at least this is my recollection of the > discussion and its resolution. 'major-mode' was left in the code and in the docs, but its meaning was changed. Hence the backward compatibility concern. And 'derived-mode' was dropped. Or you could say that 'major-mode' was dropped, and 'derived-mode' was left it, but renamed. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165529406526844 (code B ref 54296); Wed, 15 Jun 2022 11:55:01 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 11:54:25 +0000 Received: from localhost ([127.0.0.1]:36703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1RbM-0006yt-M6 for submit@debbugs.gnu.org; Wed, 15 Jun 2022 07:54:25 -0400 Received: from mail-ed1-f44.google.com ([209.85.208.44]:38838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1RbL-0006yh-E3 for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 07:54:24 -0400 Received: by mail-ed1-f44.google.com with SMTP id c2so15761138edf.5 for <54296@debbugs.gnu.org>; Wed, 15 Jun 2022 04:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Z0dRJyIhHLGv0A0wy88ZFyAPzfKuUK8AckJwUaJsnt0=; b=mOVPdSlUyNZK7O2RXgEJjXgX+FAfLLnEUFJN1Dctm04TUDFKyKJn4WxvS5V6ERV4SD HIpsHeU2Y0yuHjdhxASwJb3QKXsQxnzf7QHGUdSW3LsHk5YPBqxbcMj78o9XsrEXtFyY YKPm/CuLMe8Q0YQXqVEEQAEeX1RguOCzzpWBU2c7Dh147n2V0jo3rz+902K+99Y+tafh GUo26lRsIA9KnpMAkGhoY6iIQIqpBi1gTguNxXVVQ9DNXv8D8VF1YWILiJKTWiakEzO6 fwjj0LlXDR2cTriZ0phZptzemYPGt0MQE7VEO0xggmlYtXOd614sTPawyARNXmcANHD0 YEXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Z0dRJyIhHLGv0A0wy88ZFyAPzfKuUK8AckJwUaJsnt0=; b=lICaes7o8u3O/FtUz4t6fhVzrVBlJTM8JERoXPjZkRq07WS4le6XPVjMocSEU+qB/j +Yp/n4irkw/zPZVM7SQh91AvmA4ahLFOLPKpAFqznPVzoJvTc9pFqz73gcSQ+F+yN711 DzrwGiHP1Mg1k0dLjUbkQaLK+oHa66cAetnvRwoPI7ltqWshw1wck8OY0baw7Qnbxu3v Y4JYtAyW2i53e+W5+qNu6JxUZl55+tOvrQoN2Bofax4wb2H2UPh0oUMRIP+FuA7OP1NV k7uPaJ/EiqB8G8qkZByuL7VJpocY14ZxY5LH88moS/8oTlv4qkSbpfGhq68KOqPy66df UsPw== X-Gm-Message-State: AJIora9Dp5kuuQNSaTrH5qiFL/JmunXs2/9UhAHOo+5dtraojaZ6QvSx 1H7lFqgohTRCgrTuUbvhYIo= X-Google-Smtp-Source: ABdhPJzrGyix+3umj3o1IFs7SM0EY3oA4p+mo+WWoCyjTuJ2x4q7lWzVxY7VvBUueJSj3C/lJgmQEg== X-Received: by 2002:a50:fb99:0:b0:42d:e4fd:c368 with SMTP id e25-20020a50fb99000000b0042de4fdc368mr12260495edq.138.1655294057442; Wed, 15 Jun 2022 04:54:17 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id f22-20020a170906139600b006fec3b2e4f3sm6178937ejc.205.2022.06.15.04.54.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 04:54:17 -0700 (PDT) Message-ID: <155d8f8f-73ef-7aad-9c48-4fed2e6e25a7@yandex.ru> Date: Wed, 15 Jun 2022 14:54:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <8335g8vk0x.fsf@gnu.org> <9e53bb47-9e20-2465-28e5-0e0a64d7ae44@yandex.ru> <83mtefrr5v.fsf@gnu.org> <61d3ee65-325e-9da6-67cc-c0b0dade5dac@yandex.ru> <83h74mslhi.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83h74mslhi.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 15.06.2022 05:34, Eli Zaretskii wrote: >> Date: Tue, 14 Jun 2022 22:46:49 +0300 >> Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org >> From: Dmitry Gutov >> >> On 14.06.2022 22:17, Eli Zaretskii wrote: >>> No, I proposed to use the "predicate function" method (which already >>> exists). >> >> Then the downside is "it's not readable". Or editable, really. >> >> At this point you could say that we need to support lambas anyway (ok), >> and if people use them, we can use it for this purpose too. >> >> But it seems to me that, by not supporting lambdas so far, over the >> couple of years since its introduction, project-kill-buffer-conditions >> has kind of proven its minimal DSL to be viable. >> >> And if by having the 'major-mode eq' matcher we manage to avoid the use >> of lambdas in 99%+ use cases, then that's a win for usability. > > This is all a moot point, since eventually 'major-mode' was left in > the code. Any of the suggestions I had for removing it are therefore > purely academic at this point, nothing to argue about. 'major-mode' that was left works like 'derived-mode' did. If we take your suggestion as-is, though (and rename 'major-mode' back to 'derived-mode'), that would at least fix the main backward compatibility concern. And with that, we could go back to discussing the stuff I wrote above. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 13:21:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165529925120233 (code B ref 54296); Wed, 15 Jun 2022 13:21:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 13:20:51 +0000 Received: from localhost ([127.0.0.1]:36941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1Swx-0005GC-Gr for submit@debbugs.gnu.org; Wed, 15 Jun 2022 09:20:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1Sws-0005Fe-25 for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 09:20:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Swm-00020v-BP; Wed, 15 Jun 2022 09:20:36 -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=JB5glNvp+902Yj9Poyn3Lh5vI+1BbbXkeC3x93x4y3I=; b=ot3dIBYUf3/w uHvJGqtR0EHHEROxk9yhFky/dCF/A84CAPo7nO/VHlpsrGvGG5SC1KyxftOJRRTxvsNFE5e5WYSAF tS711+P3Of7dgKfwzXFZVkvyYTOPEhvT4F2EqVg6AdjCgdTaUN4LX+7kHIpALRfN5bq5Yl+5b0DkK yPZIc69PU3MNaRq3tUoTfZ661hRId8b0rcf/yG/zF9lVMPe7nKBrYGpKnfkA3Ck09zfxbcDXBgAmq o/rlc+fLm+rGHOgFCvMxkO8jOVj7tnLHItNmY42is15fWIE2XuuGuQ+omkHLpD27L7ForGhgoFWi2 g2pcBDkaXszkSHhNhMh8pw==; Received: from [87.69.77.57] (port=2885 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 1o1Swl-0006Pm-Oh; Wed, 15 Jun 2022 09:20:36 -0400 Date: Wed, 15 Jun 2022 16:20:26 +0300 Message-Id: <835yl2rrl1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dmitry Gutov on Wed, 15 Jun 2022 14:48:52 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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 (---) > Date: Wed, 15 Jun 2022 14:48:52 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > On 15.06.2022 05:33, Eli Zaretskii wrote: > > This seems to be some misunderstanding. I wanted us to have only > > 'derived-mode', not 'major-mode'. > > Okay?... > > > But Philip was unhappy about that, > > due to existing usage of 'major-mode', and eventually 'major-mode' was > > left in the code. Or at least this is my recollection of the > > discussion and its resolution. > > 'major-mode' was left in the code and in the docs, but its meaning was > changed. Hence the backward compatibility concern. > > And 'derived-mode' was dropped. > > Or you could say that 'major-mode' was dropped, and 'derived-mode' was > left it, but renamed. Then I'm sorry, but I don't think I have anything to do with that change. If I somehow cause Philip to make such changes, I apologize, because I never meant anything even close (and cannot understand how what I wrote could have interpreted to that effect, but that's water under the bridge). Once again, my only comment about the code was that I thought (and still think) we should not use major-mode matching, but derived-mode matching instead. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 15:57:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165530857514351 (code B ref 54296); Wed, 15 Jun 2022 15:57:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 15:56:15 +0000 Received: from localhost ([127.0.0.1]:39622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1VNO-0003jN-Qa for submit@debbugs.gnu.org; Wed, 15 Jun 2022 11:56:14 -0400 Received: from mail-ej1-f51.google.com ([209.85.218.51]:39860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1VNM-0003j6-KG for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 11:56:13 -0400 Received: by mail-ej1-f51.google.com with SMTP id y19so24126787ejq.6 for <54296@debbugs.gnu.org>; Wed, 15 Jun 2022 08:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=P/Sjjazpj+QJ2C5oZNSv/3XihrxVJxFwBDMAYOMVtLo=; b=PTmFWxMXry4hWB9pLfHZY4/863ndAA82ZUYWAL3Ltdh9BaCNZMg4dOXl3phpw+Togw iUfyp+a/JqZ+E/1RBewXGQp6QUfI3l4GSQwHLWD8fXVXexlhlyDc5iUKVItredxGU0aJ 6YeHgSBCuIQ2M5z/kp0UY3NU44067hITC6ZAu7y952uHfYNMvCcYnIY2tDnYis9jrFk9 7eTfp45iVNlkf/9aM81lJRkofmJybPPfgTt3lRngY5EFdKDrk3RfoPuSaJ/TIpv65hOr 6pMVJneR5pDGKfmzK8Nu2lX1iOxJ77oHxGV0fQKVFKZwMHrANiIHwb/TgKwcCQQBU/SP HpPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=P/Sjjazpj+QJ2C5oZNSv/3XihrxVJxFwBDMAYOMVtLo=; b=NVkUvjJKaa31U0WmMLbrrejPineQGEAhFHVBJDVevYMwtK/Bi54ioscSlqm4sTOhQ/ 8pgvb+QToF7nbF8LHnxL2L6WiWZ08JyuAVpau3Ky6uGry7GGHZYAh8hLBZEW1oyh7XXP 9JUA7faYrv3bw3iqoqqgp84gllN+vJ7Yz+/a0u6kFbbE9e4AXK4QL8lxDAmy+CLQYlpG iPKG+7LmMKFyFAMm8CjPxV3c5LijBAwcDmOBVo98sHsQw335HCda//VVu/MvCmmOwqEv zsAgQKcwe48cSpURDNVZZUaHA2FvrXnzlZtH76Su8EBHuNYh+nH3hxWb8TsqZ21sQLVV 5Ekg== X-Gm-Message-State: AJIora99ugJcFkK1myVqLrYmIjyrlcsAWRqrA4WNNAvlfrzEPoT60SgK cvm3DmMLpeJU2+HqcUM8x1s= X-Google-Smtp-Source: AGRyM1sqw2xB6UMdJetZC5U2GsrQVP186bENdsQXogv5jO4biHcekCT9I/c6d5k7RHf/tUGz0v6LmA== X-Received: by 2002:a17:906:5a4d:b0:70f:7d1c:664b with SMTP id my13-20020a1709065a4d00b0070f7d1c664bmr452407ejc.540.1655308566665; Wed, 15 Jun 2022 08:56:06 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id z12-20020a05640240cc00b0042aa5a74598sm10154158edb.52.2022.06.15.08.56.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 08:56:06 -0700 (PDT) Message-ID: <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> Date: Wed, 15 Jun 2022 18:56:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <835yl2rrl1.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 15.06.2022 16:20, Eli Zaretskii wrote: > Then I'm sorry, but I don't think I have anything to do with that > change. If I somehow cause Philip to make such changes, I apologize, > because I never meant anything even close (and cannot understand how > what I wrote could have interpreted to that effect, but that's water > under the bridge). That's easy to fix, but: > Once again, my only comment about the code was that I thought (and > still think) we should not use major-mode matching, but derived-mode > matching instead. A lot of my emails in this thread are about "we should not use major-mode matching". That we maybe should. Because we do. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 16:19:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165530989024838 (code B ref 54296); Wed, 15 Jun 2022 16:19:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 16:18:10 +0000 Received: from localhost ([127.0.0.1]:39664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1ViS-0006S5-SC for submit@debbugs.gnu.org; Wed, 15 Jun 2022 12:18:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1ViQ-0006Rt-O0 for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 12:17:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1ViF-0008OK-FM; Wed, 15 Jun 2022 12:17:52 -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=hVcgBL5re/dnoOt4UAVk20z74uGKNBZ+qy1BNqGESRo=; b=FBypS1KiY4Vp 0o2CeRwtq3J2XWER6JxFfMec9FAx+unRA8VjefOoZHaJ+fScnSGtlI97dm/gWSXX3tlUCyBY4PtZS aCzfRw/GA3bLsxO12iiJu8r5yY24g+eTDfvn9z7qMSe7AF3313NCqSzRM0+U6YvGZ4DC74WljItQn Nwxh/70ieWxPq+FWrFE8THPP0d+0cm/SGd8V1weygveQQ4a6bJPxhb3sHjynSchhFH2XKMoZemb8Z 4Rd52ZfypPcMhp4B1Qq4a+zmeMK563o2/7kO5UcEW415xtCOZyYaZp3McbgB7lvCSap/swmSEG2DL Lz5J9DlAarPsfdRT9a7bOA==; Received: from [87.69.77.57] (port=2107 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 1o1ViD-0008Hi-6t; Wed, 15 Jun 2022 12:17:47 -0400 Date: Wed, 15 Jun 2022 19:17:36 +0300 Message-Id: <83zgidrjdr.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> (message from Dmitry Gutov on Wed, 15 Jun 2022 18:56:03 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Wed, 15 Jun 2022 18:56:03 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > > Once again, my only comment about the code was that I thought (and > > still think) we should not use major-mode matching, but derived-mode > > matching instead. > > A lot of my emails in this thread are about "we should not use > major-mode matching". That we maybe should. Because we do. Did you see that "was" part in what I wrote above? I was only describing what I meant to say back then, that's all. Why beat that long-dead horse 3 months after it died? From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 16:52: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16553119164425 (code B ref 54296); Wed, 15 Jun 2022 16:52:01 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 16:51:56 +0000 Received: from localhost ([127.0.0.1]:39714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1WFH-00019I-Vj for submit@debbugs.gnu.org; Wed, 15 Jun 2022 12:51:56 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:46683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1WFD-00018y-9V for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 12:51:54 -0400 Received: by mail-wr1-f51.google.com with SMTP id u8so16133669wrm.13 for <54296@debbugs.gnu.org>; Wed, 15 Jun 2022 09:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=sXUrGdKfRREBGOHCujljfT8VtN1LUY/Q/YjuizkVyt0=; b=KzLaLZRB6jshcoqMLodhy+92aGGQuqQeRcfSidN464Yp4Mtd3aB2vn9TuuEis5WjlQ SSe839xvmSQKjZ8efd4NJBwqK/84TyA/bWWI41MAWpBIKN9vS/hEewq/TDmPNJclkHgX q9gaPLqKEaDRy420SL8Dc8KXgtfpJJWgCJ1YWtHiJATFdsNp54Rg4iCrEqPl3SWXdTZi sV2Ww8DnP5RNZRpkMj1vDbvRQWbKiDOQl3SjztdUxbmZ/8S25XIIJDG1W6qoAJ/poarR d9rywTw3y9TjDBm3zWj7IjWVAJQGeqj9oGgHOX4R6poAJHLy7v/9sw/LJwUzOAnLxrN4 JhEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=sXUrGdKfRREBGOHCujljfT8VtN1LUY/Q/YjuizkVyt0=; b=Qw0XChkD+KFcchXRGjOZclxh2UvgjUGACyXmm61UWL0rNpM4kY6CIUv/E4ozzT5AqK VVpRWeIsTTUKiAhNqIfqZTP6nf5ExzuZHhnVSrMWT3vPswdzT08R4LwwpAMn6kaZicOK z3MdLVWm5HLYlEzGA7oijJe/5sIv6QdsixyDoTY4wo+k9f7B0PSKCb1ttBW9BOBrUZWJ JQX5P7qKBPsQywN4wcnM98BgvC65GTk9OlHSk2Sx6oaodLL4HkoyMsxRe4JtvqekB1Ub TpigL/AFdUJ/oxdHNGcy12svDV0J+iq2r+A/u0JX5wI1N7EbUsOcctu1wy/uTLwEAfko VgPw== X-Gm-Message-State: AJIora9ROw4rrLkaI+fqn+xZo9MdS2pNVpNbY0hy3KYd5+6qN32V4D2n Ynj9DTIgzsW6ZMrHjntuLb0= X-Google-Smtp-Source: AGRyM1sEIyJE+U0kK8RyEV3h/cwMjv3iovKkFQYw4nTeilFtW4RPhQvp0FEchmQY05RjR98TmDN3vg== X-Received: by 2002:adf:e708:0:b0:213:b943:572a with SMTP id c8-20020adfe708000000b00213b943572amr674344wrm.560.1655311905330; Wed, 15 Jun 2022 09:51:45 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i18-20020a7bc952000000b0039c96b97359sm3026850wml.37.2022.06.15.09.51.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 09:51:44 -0700 (PDT) Message-ID: <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> Date: Wed, 15 Jun 2022 19:51:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83zgidrjdr.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 15.06.2022 19:17, Eli Zaretskii wrote: > Did you see that "was" part in what I wrote above? I was only > describing what I meant to say back then, that's all. Because your opinion made it into reality. The main problem was caused by the divergence from your suggestion (apparently), but I'm also discussing more minor ones. > Why beat that > long-dead horse 3 months after it died? Are you going to be fine with me changing 'buffer-match-p' to match the older contract of 'project-kill-buffer-conditions', with both 'major-mode' and 'derived-mode' matchers included? If yes, no more questions from me. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 17:00:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org, Dmitry Gutov Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16553123735139 (code B ref 54296); Wed, 15 Jun 2022 17:00:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 16:59:33 +0000 Received: from localhost ([127.0.0.1]:39722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1WMe-0001Kp-Ld for submit@debbugs.gnu.org; Wed, 15 Jun 2022 12:59:32 -0400 Received: from mout02.posteo.de ([185.67.36.66]:52119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1WMZ-0001KW-LQ for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 12:59:31 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 76CEB240109 for <54296@debbugs.gnu.org>; Wed, 15 Jun 2022 18:59:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1655312361; bh=ZY5WzaSRHY7AS2LddvZSOywC4Tc3uC4r/0GR2PNvNE8=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=TGsU7OBK8564VxF3IUOdYOIf8wgG81O8leCIhOSGURlM5wZqMMjGWMEBlJZXKWNdv t80X9CjjREyVdJ3cC+UGehRo9uQu3cDZSekdsxWGYX5ZSNCNyc0MXqDk2a1IYi5t8F V3r46fS83tiYpa8Z0ZEQuY3htDmRH4Q6gNQJrTQ3MyO1auv/o4gLMmVYvFEIPSmD1P ztf2chY0l5HrMf9RCPrm8lLATZEJvVtYFGAa58yFHSFxJIAsl/ZmXtyU99FMIPoYz5 a6cHUJaMK/U+FNssP7UM5fajzdy2azwh+NutBZtF4eSfL4tPNsHkyv0TceALm7JlRv 5Kc7pOOo8F+/Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LNWjz5pHzz6tmW; Wed, 15 Jun 2022 18:59:19 +0200 (CEST) From: Philip Kaludercic References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> X-Hashcash: 1:20:220615:dgutov@yandex.ru::Aw74c/PwZjvGm8z8:00gJ1 X-Hashcash: 1:20:220615:eliz@gnu.org::4uvfKu0e7sRxnjNt:0000004Mt X-Hashcash: 1:20:220615:larsi@gnus.org::4hmnyckUxezlHauM:0001hdM X-Hashcash: 1:20:220615:54296@debbugs.gnu.org::sWJDfXYVe6lpTKdJ:00000000000000000000000000000000000000003lPM 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, 15 Jun 2022 16:59:18 +0000 In-Reply-To: <835yl2rrl1.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 15 Jun 2022 16:20:26 +0300") Message-ID: <87h74lzwux.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: >> Date: Wed, 15 Jun 2022 14:48:52 +0300 >> Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org >> From: Dmitry Gutov >> >> On 15.06.2022 05:33, Eli Zaretskii wrote: >> > This seems to be some misunderstanding. I wanted us to have only >> > 'derived-mode', not 'major-mode'. >> >> Okay?... >> >> > But Philip was unhappy about that, >> > due to existing usage of 'major-mode', and eventually 'major-mode' was >> > left in the code. Or at least this is my recollection of the >> > discussion and its resolution. >> >> 'major-mode' was left in the code and in the docs, but its meaning was >> changed. Hence the backward compatibility concern. >> >> And 'derived-mode' was dropped. >> >> Or you could say that 'major-mode' was dropped, and 'derived-mode' was >> left it, but renamed. > > Then I'm sorry, but I don't think I have anything to do with that > change. If I somehow cause Philip to make such changes, I apologize, > because I never meant anything even close (and cannot understand how > what I wrote could have interpreted to that effect, but that's water > under the bridge). > > Once again, my only comment about the code was that I thought (and > still think) we should not use major-mode matching, but derived-mode > matching instead. I have to apologise myself, first of all for the mistake in the current implementation and second of all for the late response. I should have clarified what I was doing, and had assumed your comments were blocking requirements for me to push any changes. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jun 2022 17:31:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16553142118785 (code B ref 54296); Wed, 15 Jun 2022 17:31:02 +0000 Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 17:30:11 +0000 Received: from localhost ([127.0.0.1]:39760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1WqI-0002HE-Jv for submit@debbugs.gnu.org; Wed, 15 Jun 2022 13:30:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1WqE-00028q-EY for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 13:30:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Wq8-0005Xw-Ml; Wed, 15 Jun 2022 13:30:00 -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=cPDIaH92FUpaqaWa+DgpjRsiFsY0KxCZzIqjDFzBcWU=; b=nYaebLXt0jiV 26/k4oWXQeZ0Xl/m47Tpb8cHXzG/wToTSeT0bkLqJySxHmngrXjv69Au/lcsnOl6JRtvYumyVoKhH PMcR9BlNZI0Vxh1JsL4Y4kilIOAVYLCvtYTKFctmdZWB3pFBTFweOLrzwTeOcnz8YBts3k9mJIIqt iLqxLVL5wb3h5Rr5/k5pJjO56DoCFOrLCfHAMSNIvKYjg2k03zDqoA9ZR1e/Ayx6hfQ+l92jF8WXy IkAKyemLuEtmLOQdPM5GEMdpJaEb8KuVaFK72PGX/x3Xl1TxbTdoaDmdxuvyASTmmOa2RXexPVN5t /zViqA/WIzUwvijrILVJhw==; Received: from [87.69.77.57] (port=2659 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 1o1Wq8-0002LX-2E; Wed, 15 Jun 2022 13:30:00 -0400 Date: Wed, 15 Jun 2022 20:29:51 +0300 Message-Id: <83tu8lrg1c.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> (message from Dmitry Gutov on Wed, 15 Jun 2022 19:51:42 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> X-Spam-Score: -2.3 (--) 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 (---) > Date: Wed, 15 Jun 2022 19:51:42 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > On 15.06.2022 19:17, Eli Zaretskii wrote: > > Did you see that "was" part in what I wrote above? I was only > > describing what I meant to say back then, that's all. > > Because your opinion made it into reality. Sorry about that, but it was a misunderstanding of my opinion. > Are you going to be fine with me changing 'buffer-match-p' to match the > older contract of 'project-kill-buffer-conditions', with both > 'major-mode' and 'derived-mode' matchers included? I don't think I understand what you are suggesting. What is that "older contract"? Can you show a patch? From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2022 00:48: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16553404473525 (code B ref 54296); Thu, 16 Jun 2022 00:48:01 +0000 Received: (at 54296) by debbugs.gnu.org; 16 Jun 2022 00:47:27 +0000 Received: from localhost ([127.0.0.1]:40154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1dfT-0000un-Hy for submit@debbugs.gnu.org; Wed, 15 Jun 2022 20:47:27 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:43500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1dfR-0000uZ-5e for 54296@debbugs.gnu.org; Wed, 15 Jun 2022 20:47:25 -0400 Received: by mail-wm1-f45.google.com with SMTP id m16-20020a7bca50000000b0039c8a224c95so48902wml.2 for <54296@debbugs.gnu.org>; Wed, 15 Jun 2022 17:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=IGDNCZ0LJvACwOwgjhQolVCR9JbUA8npoJpDwjgRsE0=; b=BKPXcxR4EGnzZ1MdPscXTGtgwuXfTZxohVsxkHXBK0Hz+sq2C9Fs/nSa+g9L+TB0pF XaDkaUTfiAmd6V3vid3kZrZ62LbGUadr20Qcj4o1rk9ZNST7lbDAD4BAYd0Jz3kOHtFW SQHjChTf86z+A+6+W3eR8hnhtIPfpbjyJNuz21A+pdSmnPm2Jofxqmxp9NUKaahIuqBd OiG39b/vAYCTyzhK2ldVGdxhQLUO2oZVEJJwecRCbhx418JaGryJIVY7gVhjusKtMB8Z ZIKr8G6bOjE1JSUC4+1ZZFq07qKuVGDzr1b5BC42kTQ2I8sDQcHv5II7darZTkotHVT9 9xng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=IGDNCZ0LJvACwOwgjhQolVCR9JbUA8npoJpDwjgRsE0=; b=f3IJxtNKaDMHHUr1xM2dVQmJrVrH8x3Ph0Xnh+024N0BJOVKFKF9E3+cSKKhXNOtJ9 pI/j9T0FDdcbl53sSMsap0W9amC6/mj8CFVlTtn9ua4dc7bmuPXDv0AFBkUYdBK7PY99 gfmEY7XSV5U59l8hG1W1bA4K17TOo8yYtU2t002mO47ZkDMOGV4lW0+KQmhYxP5Z99Mt oKL88//wke7XzVH5zeNs9gikQR1j2MOz1ib8bO7WWg7yFDaBbL/8ST9zEouCR/tyiSkS rmPPTjcEHkHPkyxGLJb1mfj4zSUf+CXzxn6QYvUa6ACmN5KVqKgToSuMc1rQPjTJVxxU J3bQ== X-Gm-Message-State: AOAM530+0J7gqDW+zlorMKWwJGKBE03Gcgv966t6tlcTi7xw4UTya4JU 2DR4J7YHc0aGSV89ktaEB3c= X-Google-Smtp-Source: ABdhPJy80fqDMut3cjMDHfzjM1s6c7fuiyxxgE/+USbBFCsZg/3GZ1hUeYzea0jDPxZbYKRBxqY6hg== X-Received: by 2002:a05:600c:1d91:b0:39c:54f4:4f33 with SMTP id p17-20020a05600c1d9100b0039c54f44f33mr12817710wms.25.1655340439006; Wed, 15 Jun 2022 17:47:19 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id t9-20020adfeb89000000b002103bd9c5acsm307136wrn.105.2022.06.15.17.47.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 17:47:18 -0700 (PDT) Message-ID: <22f2446f-295c-09bd-6229-6b3de3509d0a@yandex.ru> Date: Thu, 16 Jun 2022 03:47:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> <83tu8lrg1c.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83tu8lrg1c.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 15.06.2022 20:29, Eli Zaretskii wrote: >> Date: Wed, 15 Jun 2022 19:51:42 +0300 >> Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org >> From: Dmitry Gutov >> >> On 15.06.2022 19:17, Eli Zaretskii wrote: >>> Did you see that "was" part in what I wrote above? I was only >>> describing what I meant to say back then, that's all. >> >> Because your opinion made it into reality. > > Sorry about that, but it was a misunderstanding of my opinion. > >> Are you going to be fine with me changing 'buffer-match-p' to match the >> older contract of 'project-kill-buffer-conditions', with both >> 'major-mode' and 'derived-mode' matchers included? > > I don't think I understand what you are suggesting. What is that > "older contract"? The value format that 'project-kill-buffer-conditions' supported before the recent change. You can look at its docstring and definition inside Emacs 28.1, for instance. > Can you show a patch? Please look at the patch attached to the very first message in this bug report. https://debbugs.gnu.org/cgi/bugreport.cgi?att=1;bug=54296;msg=5;filename=0001-Generalise-buffer-matching-from-project.el.patch The function name has changed after discussion, but the docstring is still relevant, and it mirrors 'project-kill-buffer-conditions'. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2022 05:53: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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165535872610968 (code B ref 54296); Thu, 16 Jun 2022 05:53:01 +0000 Received: (at 54296) by debbugs.gnu.org; 16 Jun 2022 05:52:06 +0000 Received: from localhost ([127.0.0.1]:40468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1iQ4-0002qI-4L for submit@debbugs.gnu.org; Thu, 16 Jun 2022 01:52:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1iQ1-0002q4-Nc for 54296@debbugs.gnu.org; Thu, 16 Jun 2022 01:51:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1iPu-0001WU-Vb; Thu, 16 Jun 2022 01:51:44 -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=FsAP1auOJgFb2DexQZmZ84nCdWP1Ietg++TLP8nRQ1c=; b=UsE9xVEqhER7 et/UK8AKzLRGFUNsEBeGevAp7FxKH8ubPST3VKzUIzBAvkKC3FyXG2J/xKYWH0a1zyVlEtBKOWoyz 2ERbtorpdu1CDHZU6XMgrOCaGZEP9ZhX7o9yzhURwRoPFxuE3Q5z2oUyDgwYxoORofLfduHjoLk5T 9yhuBZfiXjdg7tDd850hBEDrDz1J5XZwEvu40wepddpAhP6kDtsN8+GUrOfU0N4V154OuBEpUveJb Bsp+DjV84OuS4twwyUnJbVaw8GXmJxCDvgGQozFQ3iDiLhspQUtPezvgXaneiROp/CSrAQxjFGzrK QxX0dse7lWtktS6Wy1oLYg==; Received: from [87.69.77.57] (port=4191 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 1o1iPu-0003HZ-B9; Thu, 16 Jun 2022 01:51:42 -0400 Date: Thu, 16 Jun 2022 08:51:35 +0300 Message-Id: <83k09hqhp4.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <22f2446f-295c-09bd-6229-6b3de3509d0a@yandex.ru> (message from Dmitry Gutov on Thu, 16 Jun 2022 03:47:15 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> <83tu8lrg1c.fsf@gnu.org> <22f2446f-295c-09bd-6229-6b3de3509d0a@yandex.ru> X-Spam-Score: -2.3 (--) 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 (-) > Date: Thu, 16 Jun 2022 03:47:15 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > > Can you show a patch? > > Please look at the patch attached to the very first message in this bug > report. > > https://debbugs.gnu.org/cgi/bugreport.cgi?att=1;bug=54296;msg=5;filename=0001-Generalise-buffer-matching-from-project.el.patch > > The function name has changed after discussion, but the docstring is > still relevant, and it mirrors 'project-kill-buffer-conditions'. Other things changed as well, even in the doc string, and not just in name changes. Going back to the original patch makes little sense to me. So I'd still prefer to see an actual patch, before I tell whether I'm okay with it. In any case, if we will keep both major-mode and derived-mode conditions in subr.el, let's at least document that derived-mode should be preferred where it can do the job, and major-mode used only where derived-mode will not DTRT. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2022 01:22: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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165542887616443 (code B ref 54296); Fri, 17 Jun 2022 01:22:01 +0000 Received: (at 54296) by debbugs.gnu.org; 17 Jun 2022 01:21:16 +0000 Received: from localhost ([127.0.0.1]:43394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o20fk-0004H9-0g for submit@debbugs.gnu.org; Thu, 16 Jun 2022 21:21:16 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:55010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o20fg-0004Gu-Uc for 54296@debbugs.gnu.org; Thu, 16 Jun 2022 21:21:15 -0400 Received: by mail-wm1-f54.google.com with SMTP id n185so1569421wmn.4 for <54296@debbugs.gnu.org>; Thu, 16 Jun 2022 18:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=ofkDdukJEL8H2Kr8FXR0b9Tmknq1Tr9llROK/RjvT2E=; b=kzw03ojbibMQeaeYFWuJ3uQbd0rOSvWW5O5Di12iKcWBWRlUwUPujMk1eLctcZlnEQ ARYEm6G34LLTXR+xwuAkW+DieLu/REz8ddo8xuUvfVD7X0gybGDIaFWCnR1ADfhXU1wl HjyKqO4OjTUxvsq3xhuk2re45S1M590lUMUIX91bi/Q/BeVFOHI2gTUSgzigu/nIaf4N GjDluL7uZJ/+bVPVc2xtnSDhGbrZ3mL6iYFNyLFVTGqzYd3pUlaULDNk9rUu0NV8Lbof 5C4tv0BjJFiLOPFPirih7W18fw3O0F97qQMdOParbL2pTOh51mNqy37q9h1/JrgN0CM7 HV7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to; bh=ofkDdukJEL8H2Kr8FXR0b9Tmknq1Tr9llROK/RjvT2E=; b=jKpMKJkjxU0r7QNqUq6laeNQ0EdQhMgsM8TGXkp3qQgv1LJdgKoXMwQ6QymAZyYap6 ewOBMiRdWk7Z6QCxKI2QkizkeRbFgafCe0Xp1QUWfnJ/+RrO44wirRJrrRLL8/1P6jF+ nddjTdi1pSrLXCHiR8Z0HI8hGdSWDQp9hI/4CUK996rniGcupG5luRqSME/SMIL2cIBO WSJrtfbsX7M52p5IRM24o/AJkkxU0EnUWWhA1CVz3DRCPCaxa0dKVxELP9l5A5Cb80Os 9C3wMkdo9zhnqlAFjuVha/4n9KA1DgNYc1rhqPC5d0Z/rvvatNv3whpPrTm/4FbMXJmd SlPQ== X-Gm-Message-State: AJIora9XlNpy3fVZreCGbZyhO9jFjBKGCkq12yn4rZ11jxPgsJt3LTkQ lP4r/4OYCnNx71l+rHh2G18= X-Google-Smtp-Source: AGRyM1vGGwRaDOsZ9v2tE2ei9zZTxnv1fhgQMqvSMlYcwhZZ19xM5v1ZzNN4Ms+eHW/X3Shi6jdNDA== X-Received: by 2002:a05:600c:3b0d:b0:39c:4ee8:f7f4 with SMTP id m13-20020a05600c3b0d00b0039c4ee8f7f4mr7680734wms.129.1655428866923; Thu, 16 Jun 2022 18:21:06 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id y15-20020adfd08f000000b002100aa69469sm3291539wrh.2.2022.06.16.18.21.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jun 2022 18:21:06 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------tXOcFrrrLYt0THwOA82xMQR0" Message-ID: Date: Fri, 17 Jun 2022 04:21:04 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> <83tu8lrg1c.fsf@gnu.org> <22f2446f-295c-09bd-6229-6b3de3509d0a@yandex.ru> <83k09hqhp4.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83k09hqhp4.fsf@gnu.org> X-Spam-Score: 0.5 (/) 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: -0.5 (/) This is a multi-part message in MIME format. --------------tXOcFrrrLYt0THwOA82xMQR0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16.06.2022 08:51, Eli Zaretskii wrote: >> Date: Thu, 16 Jun 2022 03:47:15 +0300 >> Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org >> From: Dmitry Gutov >> >>> Can you show a patch? >> >> Please look at the patch attached to the very first message in this bug >> report. >> >> https://debbugs.gnu.org/cgi/bugreport.cgi?att=1;bug=54296;msg=5;filename=0001-Generalise-buffer-matching-from-project.el.patch >> >> The function name has changed after discussion, but the docstring is >> still relevant, and it mirrors 'project-kill-buffer-conditions'. > > Other things changed as well, even in the doc string, and not just in > name changes. Going back to the original patch makes little sense to > me. So I'd still prefer to see an actual patch, before I tell whether > I'm okay with it. > > In any case, if we will keep both major-mode and derived-mode > conditions in subr.el, let's at least document that derived-mode > should be preferred where it can do the job, and major-mode used only > where derived-mode will not DTRT. Sure. Here you go. The meat of the change is intermixed here with documentation fixes (and the addition of support for lambdas in project-kill-buffer-conditions), but they should be easy enough to tell apart. --------------tXOcFrrrLYt0THwOA82xMQR0 Content-Type: text/x-patch; charset=UTF-8; name="buffer-match-p.diff" Content-Disposition: attachment; filename="buffer-match-p.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2RvYy9saXNwcmVmL2J1ZmZlcnMudGV4aSBiL2RvYy9saXNwcmVmL2J1 ZmZlcnMudGV4aQppbmRleCAxY2JlOGJjMDkzLi4yNWU4ZTk2ZDg4IDEwMDY0NAotLS0gYS9k b2MvbGlzcHJlZi9idWZmZXJzLnRleGkKKysrIGIvZG9jL2xpc3ByZWYvYnVmZmVycy50ZXhp CkBAIC05ODEsMTMgKzk4MSwxOCBAQCBCdWZmZXIgTGlzdAogU2F0aXNmaWVkIGlmIEB2YXJ7 ZXhwcn0gZG9lc24ndCBzYXRpc2Z5IEBjb2Rle2J1ZmZlci1tYXRjaC1wfSB3aXRoCiB0aGUg c2FtZSBidWZmZXIgYW5kIEBjb2Rle2FyZ30uCiBAaXRlbSBvcgotU2F0aXNmaWVkIGlmIEB2 YXJ7b3Blcn0gaXMgYSBsaXN0IGFuZCBAZW1waHthbnl9IGNvbmRpdGlvbiBpZgorU2F0aXNm aWVkIGlmIEB2YXJ7ZXhwcn0gaXMgYSBsaXN0IGFuZCBAZW1waHthbnl9IGNvbmRpdGlvbiBp bgogQHZhcntleHByfSBzYXRpc2ZpZXMgQGNvZGV7YnVmZmVyLW1hdGNoLXB9LCB3aXRoIHRo ZSBzYW1lIGJ1ZmZlciBhbmQKIEBjb2Rle2FyZ30uCiBAaXRlbSBhbmQKLVNhdGlzZmllZCBp ZiBAdmFye29wZXJ9IGlzIGEgbGlzdCBhbmQgQGVtcGh7YWxsfSBjb25kaXRpb24gaWYKLUB2 YXJ7ZXhwcn0gc2F0aXNmaWVzIEBjb2Rle2J1ZmZlci1tYXRjaC1wfSwgd2l0aCB0aGUgc2Ft ZSBidWZmZXIgYW5kCitTYXRpc2ZpZWQgaWYgQHZhcntleHByfSBpcyBhIGxpc3QgYW5kIEBl bXBoe2FsbH0gY29uZGl0aW9ucyBpbgorQHZhcntleHByfSBzYXRpc2Z5IEBjb2Rle2J1ZmZl ci1tYXRjaC1wfSwgd2l0aCB0aGUgc2FtZSBidWZmZXIgYW5kCiBAY29kZXthcmd9LgorQGl0 ZW0gZGVyaXZlZC1tb2RlCitTYXRpc2ZpZWQgaWYgdGhlIGJ1ZmZlcidzIG1ham9yIG1vZGUg ZGVyaXZlcyBmcm9tIEB2YXJ7ZXhwcn0uCitAaXRlbSBtYWpvci1tb2RlCitTYXRpc2ZpZWQg aWYgdGhlIGJ1ZmZlcidzIG1ham9yIG1vZGUgaXMgZXEgdG8gQHZhcntleHByfS4gIFByZWZl cgordXNpbmcgQGNvZGV7ZGVyaXZlZC1tb2RlfSBpbnN0ZWFkIHdoZW4gYm90aCBjYW4gd29y ay4KIEBlbmQgdGFibGUKIEBlbmQgaXRlbWl6ZQogQGVuZCBkZWZ1bgpkaWZmIC0tZ2l0IGEv bGlzcC9wcm9nbW9kZXMvcHJvamVjdC5lbCBiL2xpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwK aW5kZXggZjRkNjc0MmVkOC4uMzBmNTE3MDRkYyAxMDA2NDQKLS0tIGEvbGlzcC9wcm9nbW9k ZXMvcHJvamVjdC5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9wcm9qZWN0LmVsCkBAIC0xMjIx LDIyICsxMjIxLDE4IEBAIHByb2plY3QtZGlzcGxheS1idWZmZXItb3RoZXItZnJhbWUKICAg KGRpc3BsYXktYnVmZmVyLW90aGVyLWZyYW1lIGJ1ZmZlci1vci1uYW1lKSkKIAogKGRlZmN1 c3RvbSBwcm9qZWN0LWtpbGwtYnVmZmVyLWNvbmRpdGlvbnMKLSAgYChidWZmZXItZmlsZS1u YW1lICAgIDsgQWxsIGZpbGUtdmlzaXRpbmcgYnVmZmVycyBhcmUgaW5jbHVkZWQuCisgICco YnVmZmVyLWZpbGUtbmFtZSAgICA7IEFsbCBmaWxlLXZpc2l0aW5nIGJ1ZmZlcnMgYXJlIGlu Y2x1ZGVkLgogICAgIDs7IE1vc3Qgb2YgdGhlIHRlbXAgYnVmZmVycyBpbiB0aGUgYmFja2dy b3VuZDoKLSAgICAsKGxhbWJkYSAoYnVmKQotICAgICAgIChub3QgKGVxIChidWZmZXItbG9j YWwtdmFsdWUgJ21ham9yLW1vZGUgYnVmKQotICAgICAgICAgICAgICAgICdmdW5kYW1lbnRh bC1tb2RlKSkpCisgICAgKG1ham9yLW1vZGUgLiBmdW5kYW1lbnRhbC1tb2RlKQogICAgIDs7 IG5vbi10ZXh0IGJ1ZmZlciBzdWNoIGFzIHhyZWYsIG9jY3VyLCB2YywgbG9nLCAuLi4KLSAg ICAoYW5kIChtYWpvci1tb2RlIC4gc3BlY2lhbC1tb2RlKQotICAgICAgICAgLChsYW1iZGEg KGJ1ZikKLSAgICAgICAgICAgIChub3QgKGVxIChidWZmZXItbG9jYWwtdmFsdWUgJ21ham9y LW1vZGUgYnVmKQotICAgICAgICAgICAgICAgICAgICAgJ2hlbHAtbW9kZSkpKSkKLSAgICAo bWFqb3ItbW9kZSAuIGNvbXBpbGF0aW9uLW1vZGUpCi0gICAgKG1ham9yLW1vZGUgLiBkaXJl ZC1tb2RlKQotICAgIChtYWpvci1tb2RlIC4gZGlmZi1tb2RlKQotICAgIChtYWpvci1tb2Rl IC4gY29taW50LW1vZGUpCi0gICAgKG1ham9yLW1vZGUgLiBlc2hlbGwtbW9kZSkKLSAgICAo bWFqb3ItbW9kZSAuIGNoYW5nZS1sb2ctbW9kZSkpCisgICAgKGFuZCAoZGVyaXZlZC1tb2Rl IC4gc3BlY2lhbC1tb2RlKQorICAgICAgICAgKG5vdCAobWFqb3ItbW9kZSAuIGhlbHAtbW9k ZSkpKQorICAgIChkZXJpdmVkLW1vZGUgLiBjb21waWxhdGlvbi1tb2RlKQorICAgIChkZXJp dmVkLW1vZGUgLiBkaXJlZC1tb2RlKQorICAgIChkZXJpdmVkLW1vZGUgLiBkaWZmLW1vZGUp CisgICAgKGRlcml2ZWQtbW9kZSAuIGNvbWludC1tb2RlKQorICAgIChkZXJpdmVkLW1vZGUg LiBlc2hlbGwtbW9kZSkKKyAgICAoZGVyaXZlZC1tb2RlIC4gY2hhbmdlLWxvZy1tb2RlKSkK ICAgIkxpc3Qgb2YgY29uZGl0aW9ucyB0byBraWxsIGJ1ZmZlcnMgcmVsYXRlZCB0byBhIHBy b2plY3QuCiBUaGlzIGxpc3QgaXMgdXNlZCBieSBgcHJvamVjdC1raWxsLWJ1ZmZlcnMnLgog RWFjaCBjb25kaXRpb24gaXMgZWl0aGVyOgpAQCAtMTI0NiwxMSArMTI0Miw5IEBAIHByb2pl Y3Qta2lsbC1idWZmZXItY29uZGl0aW9ucwogLSBhIGNvbnMtY2VsbCwgd2hlcmUgdGhlIGNh ciBkZXNjcmliZXMgaG93IHRvIGludGVycHJldCB0aGUgY2RyLgogICBUaGUgY2FyIGNhbiBi ZSBvbmUgb2YgdGhlIGZvbGxvd2luZzoKICAgKiBgbWFqb3ItbW9kZSc6IHRoZSBidWZmZXIg aXMga2lsbGVkIGlmIHRoZSBidWZmZXIncyBtYWpvcgotICAgIG1vZGUgaXMgZGVyaXZlZCBm cm9tIHRoZSBtYWpvciBtb2RlIGRlbm90ZWQgYnkgdGhlIGNvbnMtY2VsbCdzCi0gICAgY2Ry LgorICAgIG1vZGUgaXMgZXEgdG8gdGhlIGNvbnMtY2VsbCdzIGNkci4KICAgKiBgZGVyaXZl ZC1tb2RlJzogdGhlIGJ1ZmZlciBpcyBraWxsZWQgaWYgdGhlIGJ1ZmZlcidzIG1ham9yCi0g ICAgbW9kZSBpcyBlcSB0byB0aGUgY29ucy1jZWxsJ3MgY2RyICh0aGlzIGlzIGRlcHJlY2F0 ZWQgYW5kIHdpbGwKLSAgICByZXN1bHQgaW4gYSB3YXJuaW5nIGlmIHVzZWQpLgorICAgIG1v ZGUgaXMgZGVyaXZlZCBmcm9tIHRoZSBtYWpvciBtb2RlIGluIHRoZSBjb25zLWNlbGwncyBj ZHIuCiAgICogYG5vdCc6IHRoZSBjZHIgaXMgaW50ZXJwcmV0ZWQgYXMgYSBuZWdhdGlvbiBv ZiBhIGNvbmRpdGlvbi4KICAgKiBgYW5kJzogdGhlIGNkciBpcyBhIGxpc3Qgb2YgcmVjdXJz aXZlIGNvbmRpdGlvbnMsIHRoYXQgYWxsIGhhdmUKICAgICB0byBiZSBtZXQuCkBAIC0xMzA4 LDE1ICsxMzAyLDEyIEBAIHByb2plY3QtLWJ1ZmZlci1jaGVjawogICAgICAgKHdoZW4gKGNv bmQKICAgICAgICAgICAgICAoKHN0cmluZ3AgYykKICAgICAgICAgICAgICAgKHN0cmluZy1t YXRjaC1wIGMgKGJ1ZmZlci1uYW1lIGJ1ZikpKQotICAgICAgICAgICAgICgoc3ltYm9scCBj KQorICAgICAgICAgICAgICgoZnVuY3Rpb25wIGMpCiAgICAgICAgICAgICAgIChmdW5jYWxs IGMgYnVmKSkKLSAgICAgICAgICAgICAoKGVxIChjYXItc2FmZSBjKSAnZGVyaXZlZC1tb2Rl KQotICAgICAgICAgICAgICAod2FybiAiVGhlIHVzZSBvZiBgZGVyaXZlZC1tb2RlJyBpbiBc Ci1gcHJvamVjdC0tYnVmZmVyLWNoZWNrJyBpcyBkZXByZWNhdGVkLiIpCi0gICAgICAgICAg ICAgIChwcm92aWRlZC1tb2RlLWRlcml2ZWQtcAotICAgICAgICAgICAgICAgKGJ1ZmZlci1s b2NhbC12YWx1ZSAnbWFqb3ItbW9kZSBidWYpCi0gICAgICAgICAgICAgICAoY2RyIGMpKSkK ICAgICAgICAgICAgICAoKGVxIChjYXItc2FmZSBjKSAnbWFqb3ItbW9kZSkKKyAgICAgICAg ICAgICAgKGVxIChidWZmZXItbG9jYWwtdmFsdWUgJ21ham9yLW1vZGUgYnVmKQorICAgICAg ICAgICAgICAgICAgKGNkciBjKSkpCisgICAgICAgICAgICAgKChlcSAoY2FyLXNhZmUgYykg J2Rlcml2ZWQtbW9kZSkKICAgICAgICAgICAgICAgKHByb3ZpZGVkLW1vZGUtZGVyaXZlZC1w CiAgICAgICAgICAgICAgICAoYnVmZmVyLWxvY2FsLXZhbHVlICdtYWpvci1tb2RlIGJ1ZikK ICAgICAgICAgICAgICAgIChjZHIgYykpKQpkaWZmIC0tZ2l0IGEvbGlzcC9zdWJyLmVsIGIv bGlzcC9zdWJyLmVsCmluZGV4IDUwYWUzNTdhMTMuLmMxYzk3NTliMDMgMTAwNjQ0Ci0tLSBh L2xpc3Avc3Vici5lbAorKysgYi9saXNwL3N1YnIuZWwKQEAgLTY4NTUsOSArNjg1NSwxMSBA QCBidWZmZXItbWF0Y2gtcAogICBhcmd1bWVudHMsIGFuZCByZXR1cm5zIG5vbi1uaWwgaWYg dGhlIGJ1ZmZlciBtYXRjaGVzLAogLSBhIGNvbnMtY2VsbCwgd2hlcmUgdGhlIGNhciBkZXNj cmliZXMgaG93IHRvIGludGVycHJldCB0aGUgY2RyLgogICBUaGUgY2FyIGNhbiBiZSBvbmUg b2YgdGhlIGZvbGxvd2luZzoKLSAgKiBgbWFqb3ItbW9kZSc6IHRoZSBidWZmZXIgbWF0Y2hl cyBpZiB0aGUgYnVmZmVyJ3MgbWFqb3IKLSAgICBtb2RlIGlzIGRlcml2ZWQgZnJvbSB0aGUg bWFqb3IgbW9kZSBkZW5vdGVkIGJ5IHRoZSBjb25zLWNlbGwncwotICAgIGNkcgorICAqIGBk ZXJpdmVkLW1vZGUnOiB0aGUgYnVmZmVyIG1hdGNoZXMgaWYgdGhlIGJ1ZmZlcidzIG1ham9y IG1vZGUKKyAgICBpcyBkZXJpdmVkIGZyb20gdGhlIG1ham9yIG1vZGUgaW4gdGhlIGNvbnMt Y2VsbCdzIGNkci4KKyAgKiBgbWFqb3ItbW9kZSc6IHRoZSBidWZmZXIgbWF0Y2hlcyBpZiB0 aGUgYnVmZmVyJ3MgbWFqb3IgbW9kZQorICAgIGlzIGVxIHRvIHRoZSBjb25zLWNlbGwncyBj ZHIuICBQcmVmZXIgdXNpbmcgYGRlcml2ZWQtbW9kZScKKyAgICBpbnN0ZWFkIHdoZW4gYm90 aCBjYW4gd29yay4KICAgKiBgbm90JzogdGhlIGNkciBpcyBpbnRlcnByZXRlZCBhcyBhIG5l Z2F0aW9uIG9mIGEgY29uZGl0aW9uLgogICAqIGBhbmQnOiB0aGUgY2RyIGlzIGEgbGlzdCBv ZiByZWN1cnNpdmUgY29uZGl0aW9ucywgdGhhdCBhbGwgaGF2ZQogICAgIHRvIGJlIG1ldC4K QEAgLTY4NzcsNiArNjg3OSwxMCBAQCBidWZmZXItbWF0Y2gtcAogICAgICAgICAgICAgICAg ICAgICAgICAgICAoZnVuY2FsbCBjb25kaXRpb24gYnVmZmVyKQogICAgICAgICAgICAgICAg ICAgICAgICAgKGZ1bmNhbGwgY29uZGl0aW9uIGJ1ZmZlciBhcmcpKSkKICAgICAgICAgICAg ICAgICAgICAgICgoZXEgKGNhci1zYWZlIGNvbmRpdGlvbikgJ21ham9yLW1vZGUpCisgICAg ICAgICAgICAgICAgICAgICAgKGVxCisgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXIt bG9jYWwtdmFsdWUgJ21ham9yLW1vZGUgYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICAg ICAoY2RyIGNvbmRpdGlvbikpKQorICAgICAgICAgICAgICAgICAgICAgKChlcSAoY2FyLXNh ZmUgY29uZGl0aW9uKSAnZGVyaXZlZC1tb2RlKQogICAgICAgICAgICAgICAgICAgICAgIChw cm92aWRlZC1tb2RlLWRlcml2ZWQtcAogICAgICAgICAgICAgICAgICAgICAgICAoYnVmZmVy LWxvY2FsLXZhbHVlICdtYWpvci1tb2RlIGJ1ZmZlcikKICAgICAgICAgICAgICAgICAgICAg ICAgKGNkciBjb25kaXRpb24pKSkK --------------tXOcFrrrLYt0THwOA82xMQR0-- From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2022 01:23:02 +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 To: Philip Kaludercic , Eli Zaretskii Cc: 54296@debbugs.gnu.org, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165542895116557 (code B ref 54296); Fri, 17 Jun 2022 01:23:02 +0000 Received: (at 54296) by debbugs.gnu.org; 17 Jun 2022 01:22:31 +0000 Received: from localhost ([127.0.0.1]:43398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o20gx-0004Iz-Ky for submit@debbugs.gnu.org; Thu, 16 Jun 2022 21:22:31 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:35494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o20gv-0004Im-M2 for 54296@debbugs.gnu.org; Thu, 16 Jun 2022 21:22:29 -0400 Received: by mail-wr1-f47.google.com with SMTP id a15so3887669wrh.2 for <54296@debbugs.gnu.org>; Thu, 16 Jun 2022 18:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=mHCVZ/XSU1NHN+L3UaqIQaEk1j5RWxbo5jXNyNf/uUc=; b=nS/gc5Q+fxJ9VMdGJlFkXKF4lssvctVzc0QwjkB1MgkP8zs3lTu9EMuSp53syOANiB Z+pJRsQ4zK654J7/T1NnAJ7Kuo7nk6S41oiLUZDaFfFln9CmWvAqcYTrxlRC9GAHQfyw J6z4HnmOdwDdIrr9MAnqhk+kGLx3YKyhbha14YCsDCFbFJNTvIZ6+0qMMFVR5PgZIigN uwah53WcN0XMknJxplFUIjsIIhXQqIaGwPY5CoVs5QkvZEqzEM+MXaV98QY/B9Wcgspk RCggput7Thr2sCNWrqa/xYgvs1xXDhWqgQ+4BKIe9KVuZ8CxeL1k4moGrjcXngtDLiQ/ Mbtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=mHCVZ/XSU1NHN+L3UaqIQaEk1j5RWxbo5jXNyNf/uUc=; b=5DUtAH7LISIOdv8mUFTPvkVdrnhKmw82BnMmNjAwDgiKl738uA07LVZKkJ+JcPvmUy FrYm68rnu6pxD5ZPSf/b7M79rnQKXc1nkhaWpHCsqonLmngn9I0lnKY/RM+ATaiG8MNV sWKsTAd5/78gi4RjCGSFmvxmZ7O/N2i/T3R19QRBe5Ug920q/AsxqPNI+0vZSZtzUf9A bsgn0f1oQfiuypJ9aU6Md8Qu4GNAmMXse8/0QaKlj0doLeRGGTsS/cHEQ3IA5RVGP83r NR+AR32cpbQtYEiiHvhNZ5DJTUrEF32KFawgnn3ch6C0c0hYdBaKhpYM3IHqLT+H7Xlo xhnw== X-Gm-Message-State: AJIora8+YymTgwQCo9eq6APyJkox6GOOK6NcEHt2xuVlrhaqMXvuModb kJmBJMELoDnrgQEAAowco2s= X-Google-Smtp-Source: AGRyM1v8yQr8wdUnoCkgcvNUM2+x3EAaXORnciNEiNoE+gLHQslsMKuiXtOj+2oWxOCUNQsV6l1u3w== X-Received: by 2002:a05:6000:381:b0:219:bae7:41e with SMTP id u1-20020a056000038100b00219bae7041emr6975330wrf.636.1655428943846; Thu, 16 Jun 2022 18:22:23 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id u25-20020adfa199000000b002184a3a3641sm3313688wru.100.2022.06.16.18.22.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jun 2022 18:22:23 -0700 (PDT) Message-ID: Date: Fri, 17 Jun 2022 04:22:21 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <87h74lzwux.fsf@posteo.net> From: Dmitry Gutov In-Reply-To: <87h74lzwux.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 15.06.2022 19:59, Philip Kaludercic wrote: > and had assumed your comments were blocking > requirements for me to push any changes FWIW, I wouldn't blame you for having that impression. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2022 05:50:02 +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 To: Dmitry Gutov Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16554449439684 (code B ref 54296); Fri, 17 Jun 2022 05:50:02 +0000 Received: (at 54296) by debbugs.gnu.org; 17 Jun 2022 05:49:03 +0000 Received: from localhost ([127.0.0.1]:43546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o24qs-0002W8-So for submit@debbugs.gnu.org; Fri, 17 Jun 2022 01:49:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o24qr-0002VY-73 for 54296@debbugs.gnu.org; Fri, 17 Jun 2022 01:49:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o24qk-0004C2-IF; Fri, 17 Jun 2022 01:48:54 -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=qlVXruTXZkWqSaVEDhlrLaXYo8kOEvDuRYzxriDfBHM=; b=L3mORWDPhzQP LgFEzj2SFBcJw9Ym55heiPP3FJ2/35JSki1G0CYxieoL4JBpGHrRVLE250G+87HtfGz4M7d3FhVil WzSMpIq/g2Wxd3jaldt6k0RxTgM1NB+WMohES8eleOh2MMnWMwKwVQwVzXahN99AwzbfCPVPosY+Q EDTur2vZRa2ns4p7Ozmt/rqlRGd6MPZWAESPKMCwGFNvn6JWJdKhLdCN0l4f+yBib88sahR/JfzVI dypkHdQ9UYm8jz4qTCbhyZvmL8yHTfYUPLkuuNLQD3f5YlhlMn1cSkNdXuc2XXq176qyiThRXw+SP 29b+R73jAoggSeDxbAmsqw==; Received: from [87.69.77.57] (port=1206 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 1o24qi-0002uG-Ij; Fri, 17 Jun 2022 01:48:54 -0400 Date: Fri, 17 Jun 2022 08:48:48 +0300 Message-Id: <83o7yrq1q7.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dmitry Gutov on Fri, 17 Jun 2022 04:21:04 +0300) References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> <83tu8lrg1c.fsf@gnu.org> <22f2446f-295c-09bd-6229-6b3de3509d0a@yandex.ru> <83k09hqhp4.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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 (---) > Date: Fri, 17 Jun 2022 04:21:04 +0300 > Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org > From: Dmitry Gutov > > > In any case, if we will keep both major-mode and derived-mode > > conditions in subr.el, let's at least document that derived-mode > > should be preferred where it can do the job, and major-mode used only > > where derived-mode will not DTRT. > > Sure. Here you go. Fine with me, with one nit: > +Satisfied if the buffer's major mode is eq to @var{expr}. Prefer Using "eq" as a word in the manual is not a good idea. We use "is equal" elsewhere in the manual. Thanks. From unknown Thu Jun 19 14:04:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54296: Add buffer-matching functionality Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2022 13:40:02 +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 To: Eli Zaretskii Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.165547317920773 (code B ref 54296); Fri, 17 Jun 2022 13:40:02 +0000 Received: (at 54296) by debbugs.gnu.org; 17 Jun 2022 13:39:39 +0000 Received: from localhost ([127.0.0.1]:44455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2CCI-0005Oy-CZ for submit@debbugs.gnu.org; Fri, 17 Jun 2022 09:39:39 -0400 Received: from mail-ed1-f44.google.com ([209.85.208.44]:45990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2CCF-0005Oa-AR for 54296@debbugs.gnu.org; Fri, 17 Jun 2022 09:39:36 -0400 Received: by mail-ed1-f44.google.com with SMTP id d14so6210263eda.12 for <54296@debbugs.gnu.org>; Fri, 17 Jun 2022 06:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=r7in7iHfSGlyg6JqmMmVH2muNGYI0Fe/4UggZv+EsJo=; b=m6j20jTT05p+yRNGa0TIN5qbtG9WePchqaNUjWu6frPTJFg+7A3tm7IZ7lloK9/L68 /J0hk00WWRgRooqFS0H6PBfu7Ug3mO3VlGbBT7TNhr4VdDJ/z6mcC5/B14LPMX5G+ZSe eTZrwADviB9jXtG2hYbFMgsyHdnlsKvP/wmKArhHfXHojQ4WR6uwx5Ry52fpmntiOfs+ YbvA5dOYFoDvOPpClde3S3Uhc8u/GwGNE0ZoRxF95eIFzhx9l1XTU0iDxcOOlp6P/49p cEvsyCgS9D0IdkijzRpJM4ESuykQFDp4weq8+U5KvtH5WKtAlLYy8o5Q2MdpcPhHCxqQ l8yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=r7in7iHfSGlyg6JqmMmVH2muNGYI0Fe/4UggZv+EsJo=; b=U16X0ytb7/lRPnxHd+k0bRtsH1VwjOlqiIxBgywEVqWOPlB99moXgzg2W8nmArtqJW i4T3m7wB8ZFgzsZZ4hj1zbaK5TsbbZNFmAKglwdlTgCM42sPtXZk0DwpwCfWGuW0l6GE fF0G21y09yWutV+TGtWha7+r3LB5/5sZ81VgyJlcitb8dM5iwplyuzd7jMQTiBmjgF2m W3Lw9gQFa7zsuwg1tvJe207eoOgzyKg08Ko2Kxucetk/3Oo3SSZ4ZlD6e6EIhs53lHFh jY9y67EY84I/s6nLalsoiEgvgHrGD/h0egCbvQIMV5ex5tBVi8ebhg9hJmu79jPqdWz+ E6zw== X-Gm-Message-State: AJIora+IzXIwqznysVTnYqxiMfpPwkv0oL/iD/a2VJhxLbOhulubHhps eVO3ZzDEHb9mZmLUhVgn2fU= X-Google-Smtp-Source: AGRyM1uxCadE7fCTw0FlaPfGj0Gu9V92fts6eS5Ze0IHTQDiVufXamiufOHO38ze36RT/7sfpLEBIA== X-Received: by 2002:a05:6402:4490:b0:435:640c:2abb with SMTP id er16-20020a056402449000b00435640c2abbmr2955791edb.301.1655473169493; Fri, 17 Jun 2022 06:39:29 -0700 (PDT) Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id z19-20020a056402275300b004319b12371asm3982175edd.47.2022.06.17.06.39.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jun 2022 06:39:28 -0700 (PDT) Message-ID: <5f9c69a7-cf8c-0893-14a0-29f47954ed24@yandex.ru> Date: Fri, 17 Jun 2022 16:39:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US References: <87ee3d4cli.fsf@posteo.net> <87k0d35c82.fsf@gnus.org> <877d92unqn.fsf@posteo.net> <83bkyednvx.fsf@gnu.org> <87cziudmyg.fsf@posteo.net> <838rtheogd.fsf@gnu.org> <87ilskbgul.fsf@posteo.net> <83ilskcp9i.fsf@gnu.org> <87v8whio1a.fsf@posteo.net> <83czipkylw.fsf@gnu.org> <87pmmp9c63.fsf@posteo.net> <83v8wgk7tn.fsf@gnu.org> <87sfrk3b86.fsf@posteo.net> <834k0ovket.fsf@gnu.org> <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> <83pmjbrsiu.fsf@gnu.org> <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> <83ilp2sljp.fsf@gnu.org> <835yl2rrl1.fsf@gnu.org> <9ea1c445-a21e-8ac7-faae-49e01c7d4d12@yandex.ru> <83zgidrjdr.fsf@gnu.org> <18bc3bbe-4051-cf93-6c27-291240353c9f@yandex.ru> <83tu8lrg1c.fsf@gnu.org> <22f2446f-295c-09bd-6229-6b3de3509d0a@yandex.ru> <83k09hqhp4.fsf@gnu.org> <83o7yrq1q7.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83o7yrq1q7.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 17.06.2022 08:48, Eli Zaretskii wrote: >> Date: Fri, 17 Jun 2022 04:21:04 +0300 >> Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org >> From: Dmitry Gutov >> >>> In any case, if we will keep both major-mode and derived-mode >>> conditions in subr.el, let's at least document that derived-mode >>> should be preferred where it can do the job, and major-mode used only >>> where derived-mode will not DTRT. >> >> Sure. Here you go. > > Fine with me, with one nit: > >> +Satisfied if the buffer's major mode is eq to @var{expr}. Prefer > > Using "eq" as a word in the manual is not a good idea. We use "is > equal" elsewhere in the manual. Thanks, done. Backward compatibility and capability are restored. Now, if we wanted to downplay the option of doing equality comparison for major-mode, we could perhaps introduce a more general condition like 'value-equal'. That would change the definition of project-kill-buffer-conditions very slightly, still keeping it readable. And a gradual deprecation of the 'major-mode' matcher could be done. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 30f51704dc..dea11d4231 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1223,10 +1223,10 @@ project-display-buffer-other-frame (defcustom project-kill-buffer-conditions '(buffer-file-name ; All file-visiting buffers are included. ;; Most of the temp buffers in the background: - (major-mode . fundamental-mode) + (value-equal major-mode . fundamental-mode) ;; non-text buffer such as xref, occur, vc, log, ... (and (derived-mode . special-mode) - (not (major-mode . help-mode))) + (not (value-equal major-mode . help-mode))) (derived-mode . compilation-mode) (derived-mode . dired-mode) (derived-mode . diff-mode)