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

From: Juri Linkov <[email-masked]>
Date: Tue, 23 May 2023 09:52:13 +0300

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

To get it less crowded the VC modeline indicator could be shorter.
For most projects there is no need to show the backend name all the time.
So instead of "Git-emacs-29" better to add a user option to be able
to keep only the branch name, i.e. in 'vc-default-mode-line-string'
such hard-coded string should be customizable:

   (concat backend-name "-" rev))

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

Sharing between vc and project would be nice.  If possible, this will
allow a shorter modeline indicator that will combine vc and project like

  --- project-branch ---

where the project name replaces the vc-backend name.

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

Probably a boolean option would be simpler for users than such line:

  (assq-delete-all 'project-mode mode-line-format)