summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/syntax.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2019-10-27 01:33:54 +0100
committerJoão Távora <joaotavora@gmail.com>2019-10-27 01:46:56 +0100
commit63fd71cd092de8daded15e32c268215b62c488b9 (patch)
tree24c4105207ebceddd71570b241e0425306a2ce8d /lisp/emacs-lisp/syntax.el
parentf4ee7c83823b7a9369e79dafa70e4fd98633704a (diff)
downloademacs-63fd71cd092de8daded15e32c268215b62c488b9.tar.gz
emacs-63fd71cd092de8daded15e32c268215b62c488b9.tar.bz2
emacs-63fd71cd092de8daded15e32c268215b62c488b9.zip
Improve scoring algorithm for flex-style completions
The previous algorithm had two problems: it considered non-matches in the beginning and end of the string as matching "holes" and failed to penalize larger holes, making flex-score-match-tightness only effective in some corner cases. The new formula, which is described in code and in pseudo-code in the comments, fixes these problems. As a result, by default, C-h f flex now correctly bubbles up "company-search-flex-regexp" to the top, in front of "file-exists-p". With a flex-score-match-tightness smaller than 1.0, the situation is reversed. * lisp/minibuffer.el (flex-score-match-tightness): Adjust default value. Improve docstring example. (completion-pcm--hilit-commonality): Improve example. Remove unused variable. Improve algorithm.
Diffstat (limited to 'lisp/emacs-lisp/syntax.el')
0 files changed, 0 insertions, 0 deletions