|
From: | Dmitry Gutov |
Subject: | bug#59502: 29.0.50; [PATCH] Dedicated buffers per project |
Date: | Wed, 7 Dec 2022 04:35:35 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 06/12/2022 19:23, Juri Linkov wrote:
(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.I haven't tried the proposed patch yet. But it would be interesting to guess how it will behave with 'C-x p p ...'.
More testing is welcome. > Do you think it will get > the project name from the original project, or from another project > where it switches to?It all depends on what's in project-find-functions. With project-vc it will probably work as expected (module the problem that was brought up in bug#59722, but we'll need to fix that separately anyway), but it can behave unexpectedly with more complex project-finding logic, like the one favored by Stephen L. or Eli Z., where belonging to a project is not defined by the directory only. But possibly by the major mode as well.
And I'm guessing project-buffer-name-function will usually be called before the major mode is set.
[Prev in Thread] | Current Thread | [Next in Thread] |