unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Philip K." <philip@warpmail.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 42386@debbugs.gnu.org
Subject: bug#42386: Acknowledgement ([PATCH] Handle symbols in project-kill-buffers-ignores)
Date: Fri, 17 Jul 2020 19:16:12 +0200	[thread overview]
Message-ID: <87pn8udpur.fsf@warpmail.net> (raw)
In-Reply-To: <640d9aa4-01fb-23f4-b5e0-045e59233dea@yandex.ru> (message from Dmitry Gutov on Fri, 17 Jul 2020 18:43:44 +0300)

Dmitry Gutov <dgutov@yandex.ru> 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.





  reply	other threads:[~2020-07-17 17:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  8:15 bug#42386: [PATCH] Handle symbols in project-kill-buffers-ignores Philip K.
     [not found] ` <handler.42386.B.159488736413990.ack@debbugs.gnu.org>
2020-07-16  8:47   ` bug#42386: Acknowledgement ([PATCH] Handle symbols in project-kill-buffers-ignores) Philip K.
2020-07-16 15:14     ` Eli Zaretskii
2020-07-16 18:08       ` Philip K.
2020-07-16 18:16       ` Philip K.
2020-07-16 19:35         ` Eli Zaretskii
2020-07-16 22:22           ` Philip K.
2020-07-17  6:38             ` Eli Zaretskii
2020-07-17  8:16               ` Philip K.
2020-07-17 10:49                 ` Eli Zaretskii
2020-07-17 11:17                   ` Philip K.
2020-07-17 11:26                     ` Eli Zaretskii
2020-07-17 15:30                       ` Philip K.
2020-07-17 15:43                         ` Dmitry Gutov
2020-07-17 17:16                           ` Philip K. [this message]
2020-07-17 22:21                             ` Dmitry Gutov
2020-07-18 12:48                               ` Philip K.
2020-07-19 23:10                                 ` Dmitry Gutov
2020-07-20 12:07                                   ` Philip K.
2020-07-20 13:39                                     ` Dmitry Gutov
2020-07-21  9:11                                       ` Philip K.
2020-07-21 14:27                                         ` Eli Zaretskii
2020-07-21 18:35                                           ` Philip K.
2020-07-21 18:57                                             ` Eli Zaretskii
2020-07-21 20:47                                               ` Dmitry Gutov
2020-07-21 18:45                                         ` Dmitry Gutov
2020-07-21 18:51                                           ` Philip K.
2020-07-27 16:26                                             ` Dmitry Gutov
2020-07-27 18:33                                               ` Philip K.
2020-07-28 22:33                                                 ` Dmitry Gutov
2020-07-16 18:41       ` Dmitry Gutov
2020-07-16 22:46         ` Juri Linkov
2020-07-17  0:23           ` Dmitry Gutov
2020-07-16 13:43 ` bug#42386: [PATCH] Handle symbols in project-kill-buffers-ignores Dmitry Gutov
2020-07-16 18:00   ` Philip K.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn8udpur.fsf@warpmail.net \
    --to=philip@warpmail.net \
    --cc=42386@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).