Subject: bug#41890: 28.0.50; [PATCH]: Add bindings for project.el

From: Simen Heggestøyl <[email-masked]>
Date: Fri, 19 Jun 2020 12:13:05 +0200

Dmitry Gutov <[email-masked]> writes:

> On 18.06.2020 17:09, Philip K. wrote:
>
>> The patch below fixes that, but allows changing if you only want the
>> listed keys to be valid (the default) or every key in
>> project-prefix-map.
>> It turned out that the transiment map approach didn't work, as it
>> ignored the value in default-directory, thus running all commands in
>> whatever the current project was.
>
> Looks reasonable to me. But let's also hear from the original author.
>
> Simen, what do you think? The patch is at
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41890#127.

Looks good to me too!

My only gripe would be that it makes it a bit harder to add new
commands, since it now requires modifying both project-switch-commands
and project-prefix-map. Maybe we could reintroduce the helper function
we had for that purpose earlier.

-(defvar project-switch-commands
-  '((?f "Find file" project-find-file)
-    (?g "Find regexp" project-find-regexp)
-    (?d "Dired" project-dired)
-    (?v "VC-Dir" project-vc-dir)
-    (?e "Eshell" project-eshell))
-  "Alist mapping keys to project switching menu entries.
+(defcustom project-switch-commands
+  '((project-find-file . "Find file")
+    (project-find-regexp . "Find regexp")
+    (project-dired . "Dired")
+    (project-vc-dir . "VC-Dir")
+    (project-shell . "Shell")
+    (project-eshell . "Eshell"))

The project-shell command is added here, don't know if that was
intentional?

Also why not stick with the easier extensible list format? I could
imagine for instance adding long descriptions as an optimal third
element for the commands later on.

-- Simen