(completion-table-with-metadata
cands
`((category . multiple-choice)
- (annotation-function
- . ,(lambda (cand)
- (when-let ((desc (caddr (assq (aref cand 0) choices))))
- (concat " " desc))))))
+ (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))))
(buffer-name))
'((?n "no" "exit without doing anything")
(?y "yes" "kill buffer without saving")
- (?s "save and then kill" "save the buffer and then kill it"))
+ (?s "save and kill" "save the buffer and then kill it"))
nil nil (and (not use-short-answers)
(not (use-dialog-box-p)))))))
(unless (= response ?n)