aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorJoão Távora2021-05-24 16:31:39 +0100
committerJoão Távora2021-05-26 00:47:22 +0100
commit93342b5776f4ad0819b2822c17bd3b836442c218 (patch)
tree7d9393ddb47732a99052be5a58f215b00078ca3a /lisp/minibuffer.el
parent2e55201b8085d64c76d9a35bffff90a02133647e (diff)
downloademacs-scratch/annotation-function-improvements.tar.gz
emacs-scratch/annotation-function-improvements.zip
Overhaul annotation-function to match affixation-functionscratch/annotation-function-improvements
* doc/lispref/minibuf.texi (Programmed Completion): Rework annotation-function and affixation-function. * lisp/help-fns.el (help--symbol-completion-table-annotation): Rename from help--symbol-completion-table-affixation. (help--symbol-completion-table): Use help--symbol-completion-table-annotation. * lisp/minibuffer.el (minibuffer-completion-help): Interpret annotation-function with more sophistication. * lisp/simple.el (read-extended-command): Use read-extended-command--annotation (read-extended-command--annotation): Rename from read-extended-command--affixation
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index e04f1040b38..966613aa99c 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2251,11 +2251,20 @@ variables.")
2251 (funcall aff-fun completions))) 2251 (funcall aff-fun completions)))
2252 (ann-fun 2252 (ann-fun
2253 (setq completions 2253 (setq completions
2254 (mapcar (lambda (s) 2254 (mapcar
2255 (let ((ann (funcall ann-fun s))) 2255 (lambda (s)
2256 (if ann (list s ann) s))) 2256 (let* ((ann (funcall ann-fun s))
2257 completions)))) 2257 (prefix-hint
2258 2258 (and ann
2259 (get-text-property 0 'prefix ann)))
2260 (suffix-hint
2261 (and ann
2262 (get-text-property 0 'suffix ann))))
2263 (cond (prefix-hint
2264 (list s prefix-hint (or suffix-hint "")))
2265 (ann (list s ann))
2266 (t s))))
2267 completions))))
2259 (with-current-buffer standard-output 2268 (with-current-buffer standard-output
2260 (setq-local completion-base-position 2269 (setq-local completion-base-position
2261 (list (+ start base-size) 2270 (list (+ start base-size)