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

From: Stefan Kangas <[email-masked]>
Date: Fri, 14 Feb 2025 15:24:12 -0600

Dmitry Gutov <[email-masked]> writes:

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

FWIW, I actually don't mind that they're different, because one is
asking for "any command" instead of just some predefined (and displayed)
keys.

I do find the current message unclear, so I'd suggest something like

    [run command in %s]

where %s has the string face, the colon is removed (because this is not
a prompt per se), and "execute" is changed to "run" (which AFAICT is the
most commonly used terminology in Emacs, though there are exceptions).

Anyways, it's your call what to do here, but those are my two cents.