]> git.eshelyaron.com Git - emacs.git/commit
Score flex-style completions according to match tightness scratch/new-flex-completion-style
authorJoão Távora <joaotavora@gmail.com>
Tue, 12 Feb 2019 21:55:34 +0000 (21:55 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 12 Feb 2019 21:55:34 +0000 (21:55 +0000)
commit0daf79c64acce7dc0371e611e090184a90648ec1
tree1f195242cbc143332065afb41a27feb39ea3abb9
parent8b44a4bffcba71da16bf909aae6f550a5374bee1
Score flex-style completions according to match tightness

The new completion style needs to score completion matches so that we
can use it later on when sorting the completions.  This is because, in
the flex style, "foo" can now match "foobar", "frodo" and
"barfromsober" but we probably want "foobar" to appear at the top of
the completion list.

This change makes the new flex completion style add sort-order hints
under the completion string's `completion-style-sort-order' property.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Propertize
completion with 'completion-pcm-commonality-score.
(completion-flx-all-completions): Propertize completion with
completion-style-sort-order and completion-style-annotation.
lisp/minibuffer.el