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

From: Juri Linkov <[email-masked]>
Date: Fri, 02 Jun 2023 09:37:20 +0300

>>>> But not sure about your patch
>>>> since currently I have no idea how to verify its performance.
>>>> Maybe it should be pushed to master so that everyone can test it?
>>> I think the performance requirements for 'project-name' are currently
>>> rather modest: the name is only used when selecting the project (in
>>> a custom config) and when generating some buffer names. For that, the new
>>> logic should be fine.
>>>
>>> With your feature, however, project-name could be called during redisplay,
>>> and that might require better performance. So I thought you would test it
>>> together with the patch for your feature request.
>>>
>>> But I suppose if you're not working on it right this moment, I could push
>>> the patch to emacs-29, and then we could refine the performance (if
>>> necessary) on master.
>> I don't know when I'll finish the feature of displaying a project name
>> on the mode-line.  So maybe better to push your patch to emacs-29 now?
>
> All right, pushed now. Thanks for reporting this.

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)))