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: Mon, 5 Dec 2022 04:35:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

Hi again!

On 23/11/2022 07:11, Gabriel wrote:
3) Create a single defcustom to compute the name of project-related
buffers.  This is similar to how `project-compile' behaves today, but
would be a more general-purpose customization option.  This is currently
my preferred solution (see the attached patch).  I tried to make it
simple, consistent and without introducing behavior changes related to
how project-related buffers are currently named, but I am not really
happy with the implementation.  An example of how users could customize
this option is presented below:

(setopt project-buffer-name-function
         (lambda (name)
             (format "*%s-%s*"
                     (project-name (project-current))
                     name)))

A couple more thoughts: the buffer name function will generally be used before the buffer is created. The value of default-directory might even be wrong.

But even if it's not, some project backends might choose to enable or disable themselves based on the value of the major mode, which at the time that the function is called, might not be set yet.

Which is to say, it might be handy to have the project instance passed to this function as an argument, rather than have it looked up again.

Does it look feasible to you in most cases? If yes, we could rethink the story with project-compilation-buffer-name-function. Perhaps make it a function which returns a function.





reply via email to

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