From: Eshel Yaron Date: Tue, 14 Jan 2025 13:15:58 +0000 (+0100) Subject: Use 'eager-display' completion metadata in a couple more places X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e04af32a04e148835938b9349f85fa7e14a1b812;p=emacs.git Use 'eager-display' completion metadata in a couple more places --- diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 50b3630bcb6..94ed4aac60f 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -314,27 +314,27 @@ Usage example: " " (cadr elem))) choices)) (answer - (minibuffer-with-setup-hook #'minibuffer-completion-help - (completing-read - (format-prompt prompt cands) - (completion-table-with-metadata - cands - `((category . multiple-choice) - (affixation-function - . ,(lambda (cands) - (let ((max (1+ (seq-max (mapcar #'string-width cands))))) - (mapcar - (lambda (cand) - (list cand "" - (when-let ((desc (caddr (assq (aref cand 0) - choices)))) - (concat - (make-string (- max (string-width cand)) - ?\s) - (propertize desc 'face - 'completions-annotations))))) - cands)))))) - nil t nil nil cands)))) + (completing-read + (format-prompt prompt cands) + (completion-table-with-metadata + cands + `((category . multiple-choice) + (eager-display . t) + (affixation-function + . ,(lambda (cands) + (let ((max (1+ (seq-max (mapcar #'string-width cands))))) + (mapcar + (lambda (cand) + (list cand "" + (when-let ((desc (caddr (assq (aref cand 0) + choices)))) + (concat + (make-string (- max (string-width cand)) + ?\s) + (propertize desc 'face + 'completions-annotations))))) + cands)))))) + nil t nil nil cands))) (unless (string-empty-p answer) (assq (aref answer 0) choices)))) (provide 'rmc) diff --git a/lisp/help.el b/lisp/help.el index f7508ddb414..6af8458339b 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -643,8 +643,7 @@ a minor mode." ((keymapp b) (help-complete-keys (vconcat prefix e) keymaps)) ((arrayp b) (execute-kbd-macro b)) (t (call-interactively b nil (vconcat prefix e))))))) - "execute")) - (minibuffer-completion-help)) + "execute"))) (completing-read (if (seq-empty-p prefix) "Complete top-level keybinding: " diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f64a84e779f..d2faa58b526 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1203,7 +1203,8 @@ styles for specific categories, such as files, buffers, etc." (calendar-month (sort-function . identity)) (predicate-description (sort-function . identity)) (search (sort-function . identity)) - (keybinding (sort-function . minibuffer-sort-alphabetically)) + (keybinding (sort-function . minibuffer-sort-alphabetically) + (eager-display . t)) (function (styles partial-completion substring) (sort-function . minibuffer-sort-alphabetically) (affixation-function . minibuffer-function-affixation))