From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Philip K." Newsgroups: gmane.emacs.bugs Subject: bug#42386: Acknowledgement ([PATCH] Handle symbols in project-kill-buffers-ignores) Date: Fri, 17 Jul 2020 19:16:12 +0200 Message-ID: <87pn8udpur.fsf@warpmail.net> References: <878sfjkh8o.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34217"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42386@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 17 19:17:13 2020 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 1jwTyy-0008lx-NG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jul 2020 19:17:13 +0200 Original-Received: from localhost ([::1]:48764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwTyx-0004fs-Pf for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jul 2020 13:17:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwTyo-0004ep-6Z for bug-gnu-emacs@gnu.org; Fri, 17 Jul 2020 13:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jwTyn-0005Dl-S4 for bug-gnu-emacs@gnu.org; Fri, 17 Jul 2020 13:17:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jwTyn-0000WW-M8 for bug-gnu-emacs@gnu.org; Fri, 17 Jul 2020 13:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jul 2020 17:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42386 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42386-submit@debbugs.gnu.org id=B42386.15950061861966 (code B ref 42386); Fri, 17 Jul 2020 17:17:01 +0000 Original-Received: (at 42386) by debbugs.gnu.org; 17 Jul 2020 17:16:26 +0000 Original-Received: from localhost ([127.0.0.1]:57991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwTyE-0000Vd-0r for submit@debbugs.gnu.org; Fri, 17 Jul 2020 13:16:26 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:34781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwTyA-0000VN-Ci for 42386@debbugs.gnu.org; Fri, 17 Jul 2020 13:16:25 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 53F185C00F4; Fri, 17 Jul 2020 13:16:17 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 17 Jul 2020 13:16:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:cc:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm1; bh=TnDIFtfr1ahJU9P1kJtoGjc1vBSVLEmPg5tvwOx M5DE=; b=c9zC4Xz/r76MorSfZMZiiDqc5rg/kS79XxCnLolb9grsvvUz9SCsHHj piw7fwEre5A43kfI1WNqrec0scAynaztV9Y/VnN8Xk6E7BL/GXB/8uQ8msQennP6 +dx/AeMrCoi3I7+OPjwZW1Aw1n88C3vB5X1uJUzKLbUgrIaEBndvhVt6WaibeqtP DQKgDmTd2Ik7eeOeNxjkv3JI6AIUBcGqk2wM9n09nre12OXJMBBOxDY5AOwOv9yb nglU3ACfFcX9a6HSMGbVLmWnJMeDB5bCt/VQR0SL1tyOgJsNBRwaWiTgYPuf5zsg 43X6Ylp9yCOUr6jvyelwWNxDm+2FL0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=TnDIFtfr1ahJU9P1k JtoGjc1vBSVLEmPg5tvwOxM5DE=; b=VmGrZySE2P/ufIly/v1EfBaEtCojXRggI EVa10MtFd5BRo0h4qq6nXA5gmpDp2TnlzHsgEK1O6Y+tqLy2L9MuFK+BExBzUnmC AaWLUnWBmApU129CntWQexScH21kb+jt3q3/QXVxPSTqJxUuOKHwr0eK2D6WyLH7 RtYqeNHVz8VvzsWlcM1pZ63wBNuVK01A9p7TgcjRlqVZSvMibhdIqmFTbXPm97uI /LbrSzpbEO8lDuTlgsF3CS0BlCdYp/ciIUh0vT+Dm67khjOJqTkyKbtDSt66/hD6 a1D1NFeHmZDXP8RoxhAOOGKqmKEOggFw4hN4x+uUeu0RB6GTBLV1g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrfeejgddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujgffkfggtgesthdtredttddttdenucfhrhhomhepfdfrhhhilhhiphcu mfdrfdcuoehphhhilhhiphesfigrrhhpmhgrihhlrdhnvghtqeenucggtffrrghtthgvrh hnpeehueeiffevveekteffueefkeefjeekkeekfeejleeufedtudffudfgueeigeffhfen ucfkphepkeejrddugeehrddtrdduheeinecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepphhhihhlihhpseifrghrphhmrghilhdrnhgvth X-ME-Proxy: Original-Received: from localhost (p5791009c.dip0.t-ipconnect.de [87.145.0.156]) by mail.messagingengine.com (Postfix) with ESMTPA id 4709830600A6; Fri, 17 Jul 2020 13:16:16 -0400 (EDT) In-Reply-To: <640d9aa4-01fb-23f4-b5e0-045e59233dea@yandex.ru> (message from Dmitry Gutov on Fri, 17 Jul 2020 18:43:44 +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:183158 Archived-At: Dmitry Gutov writes: > On 17.07.2020 18:30, Philip K. wrote: >> (defcustom project-kill-buffers-ignores >> '("\\*Help\\*") > > You might as well update the default value. So what should be added, besides ERC? >> +- a cons-cell, where the car describes how to interpret the cdr. >> + If the car contains `major-mode', the cdr has to be the symbol >> + of a major mode, that should never be killed. > > ...and its derivatives? I'll add that. > Or I wonder if you should just use memq in the implementation. I tried to find out what major-mode hierarchies exist on my system, so I wrote (let (tree) (dolist (f features) (require f)) (mapatoms (lambda (a) (let ((p (get a 'derived-mode-parent))) (when p (push (cons p a) tree))))) (with-temp-buffer (insert "digraph {\n") (dolist (node tree) (insert (format "\"%s\" -> \"%s\";\n" (car node) (cdr node)))) (insert "}\n") (write-file "dep.dot") (shell-command "dot -Tpng dep.dot > dep.png") (delete-file "dep.dot"))) that generated an image of a tree. It seems it's mostly flat, meaning that a majority of the major modes are based on prog-mode, text-mode or special-mode. All further levels seem to be connected, such as with magit or gnus. So while I get that someone might not find it intuitive that major modes other than the one listed are not killed, I think a generous interpretation is better than killing more than one might want. > Both font-lock-global-modes and desktop-modes-not-to-save are not > applied to derivatives. Hmm, I didn't know about that. As explained, just from looking at my system, taking derivations into consideration appears to have more advantages than disadvantages, but I'm not dogmatic on that point. -- Philip K.