aboutsummaryrefslogtreecommitdiffstats
path: root/doc
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 /doc
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 'doc')
-rw-r--r--doc/lispref/minibuf.texi30
1 files changed, 17 insertions, 13 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 196dd990767..6324c2944c0 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1927,21 +1927,25 @@ completion behavior is overridden. @xref{Completion Variables}.
1927@item annotation-function 1927@item annotation-function
1928The value should be a function for @dfn{annotating} completions. The 1928The value should be a function for @dfn{annotating} completions. The
1929function should take one argument, @var{string}, which is a possible 1929function should take one argument, @var{string}, which is a possible
1930completion. It should return a string, which is displayed after the 1930completion. It may return a string, which is meant to be displayed
1931completion @var{string} in the @file{*Completions*} buffer. 1931along with @var{string} in the settings such as the
1932Unless this function puts own face on the annotation suffix string, 1932@file{*Completions*}. If the returned is propertized with strings for
1933the @code{completions-annotations} face is added by default to 1933the @code{prefix} or @code{suffix} text properties (@pxref{Text
1934that string. 1934Properties}), those properties function as more specific hints of how
1935to display. Unless this function puts own face on the annotation
1936strings, the @code{completions-annotations} face is added by default
1937to them.
1935 1938
1936@item affixation-function 1939@item affixation-function
1937The value should be a function for adding prefixes and suffixes to 1940This function does exactly the same as @code{annotation-function} but
1938completions. The function should take one argument, 1941takes priority over it and uses a different protocol. The value
1939@var{completions}, which is a list of possible completions. It should 1942should be a function for adding prefixes and suffixes to completions.
1940return such a list of @var{completions} where each element contains a list 1943The function should take one argument, @var{completions}, which is a
1941of three elements: a completion, a prefix which is displayed before 1944list of possible completions. It should return such a list of
1942the completion string in the @file{*Completions*} buffer, and 1945@var{completions} where each element contains a list of three
1943a suffix displayed after the completion string. This function 1946elements: a completion, a prefix which is displayed before the
1944takes priority over @code{annotation-function}. 1947completion string in the @file{*Completions*} buffer, and a suffix
1948displayed after the completion string.
1945 1949
1946@item group-function 1950@item group-function
1947The value should be a function for grouping the completion candidates. 1951The value should be a function for grouping the completion candidates.