[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Limits of multiline font-lock

From: Michael Heerdegen
Subject: Limits of multiline font-lock
Date: Sat, 14 Sep 2019 19:07:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)


I want to provide a hi-lock like feature for el-search patterns: an on
the fly highlighting of any expressions matching a certain el-search
pattern.  Elisp expressions can be multiline, of course.  After reading what
the manual says about multiline font lock I'm not sure if I can use
font-lock for that.

My use case is a bit different from the existing cases because I don't
need the multiline font-lock to implement a major mode.  So ideally I
don't want to mess with buffer local font-lock variables (like

I noticed that it seems to be allowed in a font-lock function
(lambda (end) ...) to look backwards, and attach the font-lock-multiline
property to text that extends to text before the font-lock search
start.  Is this correct?

I also noticed that highlighting of strings already works with something
called syntactical matching or so, so what I need seems to be already
existing but it also seems that there are no Lisp functions to reuse
this stuff.

Before I reinvent the wheel or invest unnecessary amounts of time: is it
possible to base el-search-hi-lock on font-lock?  How would I ideally



reply via email to

[Prev in Thread] Current Thread [Next in Thread]