]> git.eshelyaron.com Git - emacs.git/commit
Score flex-style completions according to match tightness
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>
Wed, 13 Feb 2019 21:23:03 +0000 (21:23 +0000)
commitb0e318d27f10b820f1cfad6ea98793c11fc782a4
tree7d01ffc214cf54a45fd8cbb654f649d3b5a15450
parente4896fcb1189f6739f228d441b6c50118536e3d8
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
"foo" can flex-match "foobar", "frodo" and "barfromsober" but we
probably want "foobar" to appear at the top of the completion list.

This change introduces a scoring formula and adds scoring hints in the
candidate string's `completion-score' property.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Propertize
completion with 'completion-score
(flex-score-falloff): New variable.
lisp/minibuffer.el