Subject: bug#76235: [PATCH] Improve prompt for 'project-switch-project'

From: Dmitry Gutov <[email-masked]>
Date: Fri, 14 Feb 2025 05:52:41 +0200

On 13/02/2025 09:03, Juri Linkov wrote:
> Instead of project--switch-project-command, I'm using
> project-prefix-or-any-command that already has
> the project root in the prompt "[execute in %s]:".
> So it's nice that project--switch-project-command
> will have the same.

Hey, do you think it should look more similar to the new addition as 
well? Something like:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 35bf66c9ffb..bbc65ddafb6 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -2035,7 +2035,7 @@ project-any-command
           (prompt-format (or prompt-format "[execute in %s]:"))
           (command (let ((overriding-terminal-local-map overriding-map))
                      (key-binding (read-key-sequence
-                                  (format prompt-format (project-root pr)))
+                                  (format-message prompt-format 
(project-root pr)))
                                   t)))
           (root (project-root pr)))
      (when command
@@ -2053,7 +2053,11 @@ project-prefix-or-any-command
  Works like `project-any-command', but also mixes in the shorter
  bindings from `project-prefix-map'."
    (interactive)
-  (project-any-command project-prefix-map "[execute in %s]:"))
+  (project-any-command project-prefix-map
+                       (concat
+                        "Execute in `"
+                        (propertize "%s" 'face 'font-lock-string-face)
+                        "':")))

  (defun project-remember-projects-under (dir &optional recursive)
    "Remember projects below a directory DIR.