]> git.eshelyaron.com Git - emacs.git/commitdiff
Use 'eager-display' completion metadata in a couple more places
authorEshel Yaron <me@eshelyaron.com>
Tue, 14 Jan 2025 13:15:58 +0000 (14:15 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 14 Jan 2025 13:28:14 +0000 (14:28 +0100)
lisp/emacs-lisp/rmc.el
lisp/help.el
lisp/minibuffer.el

index 50b3630bcb65e9cb6779e9ef658908214c674136..94ed4aac60f953e92a96748f5116359f5f0ee9f2 100644 (file)
@@ -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)
index f7508ddb414201ce9c157af0b95236bf0edc8aa3..6af8458339b9b40e4953421a8fde7fd833819f42 100644 (file)
@@ -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: "
index f64a84e779fedd61533ceb15a0ebe2bcfea56c09..d2faa58b526477554a9b7bfced88d1b1659a21c3 100644 (file)
@@ -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))