Subject: Re: bug#6310: hi-lock-set-pattern, font-lock-mode, overlays and occur

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 03 Jun 2021 10:51:26 +0200

Lennart Borgman <[email-masked]> writes:

> hi-lock-set-pattern can operate with and without font lock. In the
> latter case it uses overlays.
>
> However it locks to me like it mixes those two ways a bit:
>
> - It calls font-lock-add-keywords even when it is going to use overlays.
>
> - Secondly it checks font-lock-fontified instead of font-lock-mode to
> see whether to use overlays or not.
>
> And it does not seem to know about jit-lock:
>
> - It calls font-lock-fontify-buffer instead of jit-lock-refontify.
>
> This mean that it can't work in ocurr buffers.
>
> Beside that font-lock-mode is t in occur buffers. Is font lock used there, or?

(I'm going through old bug reports that unfortunately got no response at
the time.)

This bug report doesn't have a clear recipe, but I tried using
(hi-lock-set-pattern "This" 'highlight) in an *Occur* buffer, and it
seems to work fine.

So has this problem gone away in the years since it was reported, or are
you still seeing issues?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no