summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2019-10-26 14:13:08 +0100
committerJoão Távora <joaotavora@gmail.com>2019-10-26 14:20:39 +0100
commite21a1da8dc14c1e54a12c669255cc5496983e54e (patch)
tree056188de568affa083fa736f7c686328b751d9d5 /lisp/emacs-lisp/lisp.el
parent878ea4d840880f7bdb2d0b0142a9409d34e53f88 (diff)
downloademacs-e21a1da8dc14c1e54a12c669255cc5496983e54e.tar.gz
emacs-e21a1da8dc14c1e54a12c669255cc5496983e54e.tar.bz2
emacs-e21a1da8dc14c1e54a12c669255cc5496983e54e.zip
Allow completion styles to adjust completion metadata
This commit re-does the now-reverted commit with the same title. That version relied on generic functions, which cannot be used yet in files such as lisp/minibuffer.el. This version uses a symbol property completion--adjust-metadata instead. The new facility 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) (completion--flex-adjust-metadata): New helper. (flex): Put completion--adjust-metadata property.
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
0 files changed, 0 insertions, 0 deletions