summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2019-10-25 23:57:44 +0100
committerJoão Távora <joaotavora@gmail.com>2019-10-26 13:09:52 +0100
commit7fc0292f5c49d11fc39853f8bc25586d54221e6a (patch)
tree807713e2e4c8585553f357a0acd9057a749c1171 /lisp/emacs-lisp/lisp.el
parente3cebbb839fc94f314659bf667c6790edebf4297 (diff)
downloademacs-7fc0292f5c49d11fc39853f8bc25586d54221e6a.tar.gz
emacs-7fc0292f5c49d11fc39853f8bc25586d54221e6a.tar.bz2
emacs-7fc0292f5c49d11fc39853f8bc25586d54221e6a.zip
Allow completion styles to adjust completion metadata
The new facility, realized in the completion-adjust-metadata-for-style generic, allows completion styles to have a say in metadata properties such as cycle-sort-function and display-sort-function. This is especially useful for completion styles such as 'flex', which generally produce many matches, including some potentially "obscure" ones. The default sorting strategy would often bubble the latter to the top of the list. The sorting function for 'flex' considers pre-computed matching scores and is thus much better than the default for this particular style. Additionally, it overrides the completion table's cycle-sort-function or display-sort-function properties if they exist, although it still uses them to pre-sort the result, so that they are still relevant for resolving ties. * lisp/minibuffer.el (completion--nth-completion): Call completion-adjust-metadata-for-style. (completion-adjust-metadata-for-style): New generic. (completion-adjust-metadata-for-style 'flex): New method.
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
0 files changed, 0 insertions, 0 deletions