From bfafc405fe4e2570dd40c6d6e3ef81110ab4728a Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 23 Aug 2023 19:36:35 +0300 Subject: [PATCH] project-key-prompt-style: New option. * lisp/progmodes/project.el (project-file-history-behavior): Add :group and :version tags. (project-key-prompt-style): New option (bug#64799). * etc/NEWS: Mention it. --- etc/NEWS | 4 ++++ lisp/progmodes/project.el | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2c9f3d4e4c8..31f856601c1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -736,6 +736,10 @@ Customizing it to 'relative' makes commands like 'project-find-file' and 'project-find-dir' display previous history entries relative to the current project. +*** New user option 'project-key-prompt-style'. +The look of the key prompt in the project switcher has been changed +slightly. To get the previous one, set this option to 'brackets'. + * Incompatible Lisp Changes in Emacs 30.1 diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7c66d3e3e45..ab7376b7dc6 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1071,7 +1071,9 @@ to `project-find-file' or `project-find-dir'. This has the effect of sharing more history between projects." :type '(choice (const t :tag "Default behavior") - (const relativize :tag "Adjust to be relative to current"))) + (const relativize :tag "Adjust to be relative to current")) + :group 'project + :version "30.1") (defun project--transplant-file-name (filename project) (when-let ((old-root (get-text-property 0 'project filename))) @@ -1902,6 +1904,17 @@ listed in the dispatch menu produced from `project-switch-commands'." :group 'project :version "28.1") +(defcustom project-key-prompt-style (if (facep 'help-key-binding) + t + 'brackets) + "Which presentation to use when asking to choose a command by key. + +When `brackets', use text brackets and `bold' for the character. +Otherwise, use the face `help-key-binding' in the prompt." + :type 'boolean + :group 'project + :version "30.1") + (defun project--keymap-prompt () "Return a prompt for the project switching dispatch menu." (mapconcat @@ -1914,7 +1927,7 @@ listed in the dispatch menu produced from `project-switch-commands'." (let ((key (if key (vector key) (where-is-internal cmd (list project-prefix-map) t)))) - (if (facep 'help-key-binding) + (if (not (eq project-key-prompt-style 'brackets)) (format "%s %s" (propertize (key-description key) 'face 'help-key-binding) label) -- 2.39.2