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

From: Spencer Baugh <[email-masked]>
Date: Mon, 22 May 2023 15:49:59 -0400

Eli Zaretskii <[email-masked]> writes:

>> From: Juri Linkov <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked]
>> Date: Mon, 22 May 2023 20:48:08 +0300
>> 
>> >> It can be used for anything.  For example, to display the project name
>> >> on the mode-line.  (Then better to cache the project name in a new
>> >> buffer-local variable.)
>> >
>> > I don't see anything but the menu in the patch you suggested.  I
>> > understand that in principle we could do many things there, but if you
>> > are proposing a real patch, not just an initial idea, please show all
>> > of the code you want to include in this mode.
>> 
>> Actually I miss this feature very much.  There is already the mode-line
>> indication with the VC system name and the VC branch name, but
>> no indication with a project name, so similar files
>> in different projects all are showing the same "Git-master".
>
> We can show this on the mode line always, whenever there's a project.
> No need for a minor mode.

This might get crowded when there's also the VC modeline indicator.

Still, I would like this feature.  And actually, the mention of VC makes
me realize: We already do something expensive by default for every new
buffer: Query the VC state.  So maybe it's not so bad to run
project-current every time we make a new buffer?  Or at least, in the
exact same situations that we query the VC state?  Maybe we can even
implement some sharing between the project-current lookup and the VC
state query, for the vc project backend?

>> Now here is the implementation of 'project-mode' based on 'vc-mode',
>> and 'project-menu-entry' based on 'vc-menu-entry' that shows
>> a project name alongside of vc info, and the mouse click opens
>> the project menu using 'menu-bar-project-menu' implemented by Spencer.
>
> I still don't understand why this has to be a minor mode.  Both
> mode-line indication and the menu bar can show this stuff regardless
> of any mode.  It sounds like this mode is an unnecessary complication.

(I personally agree that this should be always on, with perhaps a user
option to turn it off.)