From: Dmitry Gutov <dmitry@gutov.dev>
To: Juri Linkov <juri@linkov.net>
Cc: sbaugh@janestreet.com, Eli Zaretskii <eliz@gnu.org>,
63469@debbugs.gnu.org
Subject: bug#63469: 29.0.90; project.el doesn't add menu-bar entries
Date: Wed, 24 May 2023 04:00:20 +0300 [thread overview]
Message-ID: <0a09aefc-85b4-ec8d-e9a7-d7e881d4a96b@gutov.dev> (raw)
In-Reply-To: <86ttw3blc6.fsf@mail.linkov.net>
On 23/05/2023 09:46, Juri Linkov wrote:
>>> +(define-minor-mode project-mode
>>> + "Toggle display of project menu in the project-aware buffers."
>>> + (if project-mode
>>> + (setq-local project-name (concat
>>> + " "
>>> + (propertize
>>> + (project-name (project-current))
>>> + 'mouse-face 'mode-line-highlight
>>> + 'local-map project-mode-line-map)))))
>>
>> At the very least, this will need some better name, because project
>> features don't need any mode to be turned on to be used.
>>
>> project-menu-mode?
>
> 'project-mode' will be more like 'vc-mode' that actually is not a minor mode.
> I don't know why it was named 'vc-mode'.
vc-mode is not a mode at all: you can't choose to enable or disable it.
>> Next, I'm not quite sure about the caching of project-name. There is no
>> scenario when it will be invalidated, right?
>
> I can't imagine such scenario.
Any scenario where the user assigns of changes the name, e.g. by
changing the value of project-vc-name.
>> Try simply calling (project-name (project-current t)) every time, see how
>> the performance is. Or, more thoroughly, copy the if-let logic from
>> project-prefixed-buffer-name.
>
> Ok, will try.
>
> BTW, there is another problem: by default 'project-name' is defined as
> (file-name-nondirectory (directory-file-name (project-root project))).
> But then project name often is the same for different projects
> because the directory name is the same for the same repository.
> For example, in a subtree:
>
> emacs-master/emacs/...
> emacs-29/emacs/...
> emacs-28/emacs/...
>
> All project names are the same 'emacs'. How would it be possible to
> customize project names? Trying to get a parent dir might be too
> unreliable. So probably the only way is to define the name manually.
> Maybe in .dir-locals.el. Actually this works:
>
> ((nil . ((project-vc-name . "emacs-29"))))
>
> Not sure why non-VC projects can't be named the same way.
They can -- using whatever way the respective backend provides.
> Also noticed that project-vc-name is not marked as safe,
> so always asks a confirmation.
next prev parent reply other threads:[~2023-05-24 1:00 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh
2023-05-12 19:09 ` Eli Zaretskii
2023-05-12 19:25 ` Dmitry Gutov
2023-05-15 16:49 ` Juri Linkov
2023-05-15 18:15 ` Spencer Baugh
2023-05-15 18:19 ` Eli Zaretskii
2023-05-15 18:11 ` Spencer Baugh
2023-05-15 18:37 ` Eli Zaretskii
2023-05-15 18:46 ` Spencer Baugh
2023-05-16 16:09 ` Eli Zaretskii
2023-05-16 17:09 ` Spencer Baugh
2023-05-17 11:30 ` Eli Zaretskii
2023-05-17 14:50 ` Spencer Baugh
2023-05-18 6:53 ` Dmitry Gutov
2023-05-18 7:01 ` Eli Zaretskii
2023-05-18 9:49 ` Dmitry Gutov
2023-05-18 10:23 ` Eli Zaretskii
2023-05-18 14:30 ` Spencer Baugh
2023-05-18 15:15 ` Eli Zaretskii
2023-05-18 15:57 ` Juri Linkov
2023-05-18 16:06 ` Eli Zaretskii
2023-05-18 19:34 ` Dmitry Gutov
2023-05-19 6:56 ` Juri Linkov
2023-05-19 10:44 ` Eli Zaretskii
2023-05-19 17:46 ` Juri Linkov
2023-05-19 18:28 ` Eli Zaretskii
2023-05-22 17:48 ` Juri Linkov
2023-05-22 18:20 ` Eli Zaretskii
2023-05-22 19:49 ` Spencer Baugh
2023-05-22 19:54 ` Dmitry Gutov
2023-05-22 21:20 ` Spencer Baugh
2023-05-22 21:30 ` Dmitry Gutov
2023-05-23 13:57 ` Michael Albinus
2023-05-24 1:07 ` Dmitry Gutov
2023-05-24 8:38 ` Michael Albinus
2023-05-23 6:52 ` Juri Linkov
2023-05-23 11:17 ` Eli Zaretskii
2023-05-23 18:08 ` Juri Linkov
2023-05-24 1:10 ` Dmitry Gutov
2023-05-24 6:25 ` Juri Linkov
2023-05-25 1:15 ` Dmitry Gutov
2023-05-25 6:35 ` Juri Linkov
2023-05-25 16:17 ` Dmitry Gutov
2023-05-23 6:49 ` Juri Linkov
2023-05-22 19:59 ` Dmitry Gutov
2023-05-23 6:46 ` Juri Linkov
2023-05-23 18:11 ` Juri Linkov
2023-05-24 1:03 ` Dmitry Gutov
2023-05-24 6:29 ` Juri Linkov
2023-05-25 1:14 ` Dmitry Gutov
2023-05-25 6:29 ` Juri Linkov
2023-05-25 16:14 ` Dmitry Gutov
2023-05-25 18:41 ` Juri Linkov
2023-05-25 22:19 ` Dmitry Gutov
2023-05-30 17:51 ` Juri Linkov
2023-06-02 2:11 ` Dmitry Gutov
2023-06-02 6:37 ` Juri Linkov
2023-06-03 1:36 ` Dmitry Gutov
2023-05-24 1:00 ` Dmitry Gutov [this message]
2023-05-19 14:42 ` Spencer Baugh
2023-05-19 17:41 ` Juri Linkov
2023-06-28 0:54 ` Spencer Baugh
2023-06-28 6:52 ` Juri Linkov
2023-06-29 15:30 ` Spencer Baugh
2023-06-29 17:31 ` Juri Linkov
2023-06-29 18:03 ` Eli Zaretskii
2023-06-29 19:22 ` Spencer Baugh
2023-06-30 5:32 ` Eli Zaretskii
2023-06-30 15:55 ` Spencer Baugh
2023-07-01 9:44 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0a09aefc-85b4-ec8d-e9a7-d7e881d4a96b@gutov.dev \
--to=dmitry@gutov.dev \
--cc=63469@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=juri@linkov.net \
--cc=sbaugh@janestreet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).