From 05110f50a16ab02b9646b4080b50c94dad58e8f3 Mon Sep 17 00:00:00 2001 From: shipmints Date: Thu, 13 Feb 2025 00:29:37 +0200 Subject: [PATCH] Change the project-switch-project prompt to include the dir name * lisp/progmodes/project.el: (project--switch-project-command): Add new argument DIR. Change the prompt to "Command in `xxx': ..." (bug#76235). (project-switch-project): Pass DIR to the above function. (cherry picked from commit 86e17fbcbddb57b0653b7046202e54624c477836) --- lisp/progmodes/project.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 12e934e0fa5..b7e1db820b5 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -2221,7 +2221,7 @@ Otherwise, use the face `help-key-binding' in the prompt." project-switch-commands " ")) -(defun project--switch-project-command () +(defun project--switch-project-command (&optional dir) (let* ((commands-menu (mapcar (lambda (row) @@ -2251,7 +2251,14 @@ Otherwise, use the face `help-key-binding' in the prompt." (propertize "Unrecognized input" 'face 'warning) (help-key-description choice nil))))) - (setq choice (read-key-sequence (concat "Choose: " prompt))) + (setq choice (read-key-sequence (concat + (if dir + (format-message "Command in `%s': " + (propertize + dir 'face + 'font-lock-string-face)) + "Command: ") + prompt))) (when (setq command (lookup-key commands-map choice)) (when (numberp command) (setq command nil)) (unless (or project-switch-use-entire-map @@ -2276,7 +2283,7 @@ to directory DIR." (project--remember-dir dir) (let ((command (if (symbolp project-switch-commands) project-switch-commands - (project--switch-project-command))) + (project--switch-project-command dir))) (buffer (current-buffer))) (unwind-protect (progn -- 2.39.5