Subject: bug#77054: Completion highlighting applied outside completion-lazy-hilit-fn

From: João Távora <[email-masked]>
Date: Tue, 18 Mar 2025 22:32:47 +0000

On Sun, Mar 16, 2025 at 3:52 PM Eli Zaretskii <[email-masked]> wrote:

> > Steps to reproduce (Emacs 30.1):
> > - emacs -Q
> > - Load:
> >     - https://github.com/minad/vertico/
> >     - https://github.com/lewang/flx/
> >     - https://gist.github.com/joca-bt/356ba1201c4fe842144e19ee1c723c28/
> > - Eval:
> >    - (vertico-mode t)
> >    - (setopt completion-styles '(flx))
>
> Thank you for your report.
>
> Adding João Távora, the original author of this feature, to the
> discussion.

Hi (and hi João! nice to hear from you and know you're still an Emacs
user)

Anyway, this was about 1,5 years agora and I'm afraid I don't have
the  details in my mental cache nor do I have the time to test this
complex setup.  AFAIK this feature has been in Emacs at least for
a full major version cycle (29) and had it failed in its basic mission
we would have heard about it.  I also remember testing it thoroughly.

It's important to note that completion-lazy-highlight-fn is not the only
variable involved in this scheme.  There is another:
completion-lazy-hilit.  I don't see it mentioned in this report. Both
need to be set for lazy highlighting to take place and actually save work.

completion-lazy-hilit is to be set by the frontend: (that would be vertico?)
while c-lazy-hilit-fn is set by the style.  At least according to the
docstrings
I wrote at the time, and which I suggest reading.

HTH,
João