1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Support more metadata properties in completion-category-overrides (bug#68214)

* doc/lispref/minibuf.texi (Completion Variables): Add
to the table of completion-category-overrides new items:
`cycle-sort-function', `group-function', `annotation-function',
`affixation-function'.

* lisp/minibuffer.el (completion-metadata-get): Try also to get
the property from completion-category-overrides by category.
Suggested by Daniel Mendler <mail@daniel-mendler.de>.
(completion-category-defaults): Add new properties to docstring.
(completion-category-overrides): Add customization for new
properties: `cycle-sort-function', `group-function',
`annotation-function', `affixation-function'.
(completion-metadata-override-get): Remove function.
(minibuffer-completion-help): Replace 'completion-metadata-override-get'
with 'completion-metadata-get' for 'display-sort-function'.
This commit is contained in:
Juri Linkov 2024-01-07 20:04:06 +02:00
parent aadcb90609
commit 18de131222
3 changed files with 60 additions and 16 deletions

View file

@ -1879,17 +1879,30 @@ The value should be a value for @code{completion-cycle-threshold}
(@pxref{Completion Options,,, emacs, The GNU Emacs Manual}) for this
category.
@item cycle-sort-function
The function to sort entries when cycling.
@item display-sort-function
The function to sort entries in the @file{*Completions*} buffer.
The possible values are: @code{nil}, which means to use either the
sorting function from metadata or if that is @code{nil}, fall back to
@code{completions-sort}; @code{identity}, which means not to sort at
all, leaving the original order; or any other value out of those used
in @code{completions-sort} (@pxref{Completion Options,,, emacs, The
GNU Emacs Manual}).
@item group-function
The function to group completions.
@item annotation-function
The function to add annotations to completions.
@item affixation-function
The function to add prefixes and suffixes to completions.
@end table
@noindent
Additional alist entries may be defined in the future.
See @ref{Programmed Completion}, for a complete list of metadata entries.
@end defopt
@defvar completion-extra-properties