]> git.eshelyaron.com Git - emacs.git/commit
Allow completion frontends to highlight completion strings just in time
authorJoão Távora <joaotavora@gmail.com>
Sat, 14 Aug 2021 08:25:35 +0000 (09:25 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 15 Aug 2021 00:23:34 +0000 (01:23 +0100)
commit4e1da63bef392c0e540f07af7304d278b4dc46f4
treefed8b03461b165dfd63f1b7ff120a90c48073b1c
parent254dc6ab4ca8e6a549a795f9eaf45378ce51b61f
Allow completion frontends to highlight completion strings just in time

This allows completion-pcm--hilit-commonality to be sped up
substantially.

Introduce a new variable completion-lazy-hilit that allows for
completion frontends to opt-in an time-saving optimization by some
completions styles, such as the 'flex' and 'pcm' styles.

The variable must be set by the frontend to a unique value around a
completion attempt/session.  See completion-lazy-hilit docstring for
more info.

* lisp/icomplete.el (icomplete-minibuffer-setup): Set completion-lazy-hilit.
(icomplete--render-vertical): Call completion-lazy-hilit.
(icomplete-completions): Call completion-lazy-hilit.

* lisp/minibuffer.el (completion-lazy-hilit): New variable.
(completion-lazy-hilit): New function.
(completion-pcm--hilit-commonality): Use completion-lazy-hilit.
lisp/icomplete.el
lisp/minibuffer.el