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

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

bug#63469: 29.0.90; project.el doesn't add menu-bar entries


From: Dmitry Gutov
Subject: bug#63469: 29.0.90; project.el doesn't add menu-bar entries
Date: Sat, 3 Jun 2023 04:36:25 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 02/06/2023 09:37, Juri Linkov wrote:
Sorry that I noticed this only now, but would such optimization make sense?
Instead of

(cl-defmethod project-name ((project (head vc)))
   (or (project--value-in-dir 'project-vc-name (project-root project))
       (cl-call-next-method)))

first check if .dir-local.el already assigned a buffer-local value
before trying to get it from the root:

(cl-defmethod project-name ((project (head vc)))
   (or project-vc-name
       (project--value-in-dir 'project-vc-name (project-root project))
       (cl-call-next-method)))

It might, but this way you lose one of the niceties of relying on 'project--value-in-dir': an edit to .dir-locals.el takes effect automatically in all related buffers, without having to revert them. It might not be too important, of course.

Another thing, though, is that will do nothing about the worst case: when project-vc-name has not been customized or set locally. So if project--value-in-dir doesn't work fast enough for some particular purpose (such as using project name in the mode-line), it will remain a problem for many buffers anyway.





reply via email to

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