bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59502: 29.0.50; [PATCH] Dedicated buffers per project


From: Dmitry Gutov
Subject: bug#59502: 29.0.50; [PATCH] Dedicated buffers per project
Date: Sat, 10 Dec 2022 03:50:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 07/12/2022 09:50, Juri Linkov wrote:
(setopt project-buffer-name-function
    (lambda (project _command-symbol buffer-name)
      (format "%s<%s>" buffer-name (project-name project))))
I think*prjname/Shell Command Output*  sounds nice enough.

If it doesn't, we probably wouldn't choose*Shell Command Output*  as the
name for non-project buffers of this type, would we?
For designing a naming scheme, I suggest to keep in mind that
the users might already have customized the behavior for
displaying these buffers by using display-buffer-alist
that often takes into account a uniquified suffix, e.g.:

   "\\`\\*\\(?:Shell Command Output\\|xref\\|vc-dir\\|compilation\\)
       \\*\\(?:<[^>]+>\\)?\\'"

So for compatibility it would be better to add the project name
in the suffix without changing the standard base buffer names, e.g.:

   "*Shell Command Output*<project-a>", "*xref*<project-b>"

But if you want to add the project name after the first asterisk,
this is easy to do as well with just:

   (setf (substring buffer-name 1 1) (project-name project))

The naming scheme is often affected by the uniquify package, and different people use different ordering. Should we really go there?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]