" " (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)
((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: "
(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))