Subject: bug#31915: 26.0.50; highlight-regexp does not highlight regexp

From: Eli Zaretskii <[email-masked]>
Date: Wed, 20 Jun 2018 20:07:51 +0300

> From: Markus Triska <[email-masked]>
> Date: Wed, 20 Jun 2018 18:26:13 +0200
> 
> Please invoke Emacs via:
> 
>     $ emacs -Q --eval "(let ((x \"x\"))                 \
>                          (find-file x)                  \
>                          (insert x)                     \
>                          (highlight-regexp x 'hi-green) \
>                          (when font-lock-mode (insert x)))"
> 
> The docstring of highlight-regexp states:
> 
>     Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
>     use overlays for highlighting.  If overlays are used, the
>     highlighting will not update as you type.
> 
> Since font-lock-mode is clearly enabled when the second "x" is inserted,
> I expect it to be highlighted.

Actually, that buffer is in Fundamental mode, where there's no
font-lock.  Somehow, I suspect you already know that.

> Could you please adapt the docstring or, alternatively, highlight-regexp
> to match what is documented with what is observed?

Would it suffice to say "Note that in Fundamental mode, there's no
font lock, so overlays are always used"?  Or did you mean something
else?

Thanks.