From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54296: Add buffer-matching functionality Date: Wed, 15 Jun 2022 05:33:14 +0300 Message-ID: <83ilp2sljp.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37709"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 15 04:34:16 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o1IrH-0009gJ-U3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Jun 2022 04:34:16 +0200 Original-Received: from localhost ([::1]:56214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1IrG-0007BP-Oh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jun 2022 22:34:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Ir4-0007B2-CF for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 22:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1Ir4-000413-3U for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 22:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o1Ir4-0002Fn-0S for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 22:34:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 54296-submit@debbugs.gnu.org id=B54296.16552604118626 (code B ref 54296); Wed, 15 Jun 2022 02:34:01 +0000 Original-Received: (at 54296) by debbugs.gnu.org; 15 Jun 2022 02:33:31 +0000 Original-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 Original-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 Original-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==; Original-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 In-Reply-To: <6dd7e47d-4115-7e2c-4ee0-d4e00f684a90@yandex.ru> (message from Dmitry Gutov on Tue, 14 Jun 2022 22:36:55 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:234549 Archived-At: > 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.