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

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 12 May 2023 17:49:02 UTC

Severity: normal

Found in version 29.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Juri Linkov <juri <at> linkov.net>
Cc: sbaugh <at> janestreet.com, Eli Zaretskii <eliz <at> gnu.org>, 63469 <at> debbugs.gnu.org
Subject: bug#63469: 29.0.90; project.el doesn't add menu-bar entries
Date: Thu, 25 May 2023 19:14:36 +0300
On 25/05/2023 09:29, Juri Linkov wrote:
>>> I see no way to set the same project name both for
>>> non-file and file buffers.
>>
>> Please try the patch below. It might have non-negligible effect on
>> performance though. Please try and report back.
>>
>> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
>> index 7c51778d5d4..1494665d565 100644
>> --- a/lisp/progmodes/project.el
>> +++ b/lisp/progmodes/project.el
>> @@ -816,8 +816,8 @@ project-buffers
>>           (push buf bufs)))
>>       (nreverse bufs)))
>>
>> -(cl-defmethod project-name ((_project (head vc)))
>> -  (or project-vc-name
>> +(cl-defmethod project-name ((project (head vc)))
>> +  (or (project--value-in-dir 'project-vc-name (project-root project))
>>         (cl-call-next-method)))
> 
> Thanks, I confirm this uses project-vc-name from dir-locals in non-file buffers.

If you had a chance to verify that the performance is good enough (for 
using the result in the mode-line), that would be great.

Either way...

>>> The standard solution is just to use e.g.:
>>> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp)
>>
>> Huh, so the attribute :safe only makes proper sense for preloaded packages
>> and autoloaded defcustom forms (which are discouraged anyway).
>>
>> Do you want to write a patch for all those vars in project.el? It will
>> probably make sense to push it to emacs-29.
> 
> With this patch the problem is solved.  I can push it to emacs-29.

...this patch LGTM too. Please go ahead and install it, or even both 
patches.





This bug report was last modified 2 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.