mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
The greedy regexp matching, broken scoring and broken highlight were sources of frequent complaints about the 'flex' matching style. This commit fixes that. Inspired by the 'hotfuzz' style (available at https://github.com/axelf4/hotfuzz) it uses a modified version of Gotoh's 1982 dynamic programming algorithm. It is strictly more correct than the "old" flex. For example, when matching the pattern 'goto' to no longer will 'eglot-format' be sorted before some hypothetical much better 'goobarbaz-goto'. And of course the highlighting is also correctly placed on the 'goto', not scattered across the candidate. Regarding performance, it is faster than the naive 'flex', primarily because of the Elisp rewrite in minibuffer.el. The matching and costing algorithm matters but is not the bottleneck. The Elisp parts of the style were almost completely decoupled from the pcm/substring styles in lisp/minibuffer.el. Only 'completion-flex-try-completion' uses some of pcm's code for pattern augmentation. * src/minibuf.c (completion--flex-cost-gotoh): New function. * lisp/minibuffer.el (completion-flex--pattern-str): New variable. (flex-score-match-tightness): Make obsolete. (completion--flex-all-completions-1): New helper function. (completion-flex-try-completion, completion-flex-all-completions): Rewrite. (completion-substring--all-completions): No longer take transform-pattern-fn. (completion--flex-adjust-metadata): Tweak. (completion--flex-score, completion--flex-score-1) (completion--flex-score-last-md, completion-flex--make-flex-pattern): Delete. * test/lisp/minibuffer-tests.el (completion--sorted-flex-completions): New helper function. (completion-flex-test-non-ascii): New test. (completion--pcm-score): Delete. (completion-pcm-test-3, completion-pcm-test-4) (completion-substring-test-1, completion-substring-test-2) (completion-flex-test-2, completion-flex-test-3): Tweak. * etc/NEWS: Describe change. |
||
|---|---|---|
| .. | ||
| charsets | ||
| e | ||
| forms | ||
| gnus | ||
| images | ||
| nxml | ||
| org | ||
| refcards | ||
| schema | ||
| srecode | ||
| themes | ||
| tutorials | ||
| AUTHORS | ||
| CALC-NEWS | ||
| ChangeLog.1 | ||
| compilation.txt | ||
| COPYING | ||
| copyright-assign.txt | ||
| DEBUG | ||
| DEVEL.HUMOR | ||
| DISTRIB | ||
| edt-user.el | ||
| EGLOT-NEWS | ||
| emacs-buffer.gdb | ||
| emacs-mail.desktop | ||
| emacs.desktop | ||
| emacs.icon | ||
| emacs.metainfo.xml | ||
| emacs.service | ||
| emacs_lldb.py | ||
| emacsclient-mail.desktop | ||
| emacsclient.desktop | ||
| enriched.txt | ||
| ERC-NEWS | ||
| ETAGS.EBNF | ||
| ETAGS.README | ||
| future-bug | ||
| gnus-tut.txt | ||
| grep.txt | ||
| HELLO | ||
| HISTORY | ||
| JOKES | ||
| MACHINES | ||
| MH-E-NEWS | ||
| NEWS | ||
| NEWS.1-17 | ||
| NEWS.18 | ||
| NEWS.19 | ||
| NEWS.20 | ||
| NEWS.21 | ||
| NEWS.22 | ||
| NEWS.23 | ||
| NEWS.24 | ||
| NEWS.25 | ||
| NEWS.26 | ||
| NEWS.27 | ||
| NEWS.28 | ||
| NEWS.29 | ||
| NEWS.30 | ||
| NEXTSTEP | ||
| NXML-NEWS | ||
| ORG-NEWS | ||
| org.gnu.emacs.defaults.gschema.xml | ||
| package-autosuggest.eld | ||
| package-keyring.gpg | ||
| PROBLEMS | ||
| ps-prin0.ps | ||
| ps-prin1.ps | ||
| publicsuffix.txt | ||
| README | ||
| rgb.txt | ||
| ses-example.ses | ||
| spook.lines | ||
| symbol-releases.eld | ||
| TERMS | ||
| TODO | ||
| w32-feature.el | ||
This directory contains the architecture-independent files used by or with Emacs. This includes some text files of documentation for GNU Emacs or of interest to Emacs users, and the file of dumped docstrings for Emacs functions and variables. COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES File: emacs.icon Author: Sun Microsystems, Inc Copyright (C) 1999, 2001-2026 Free Software Foundation, Inc. License: GNU General Public License version 3 or later (see COPYING)