unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Limits of multiline font-lock
@ 2019-09-14 17:07 Michael Heerdegen
  2019-09-15 12:28 ` Stefan Monnier
  2019-09-18 21:13 ` Adam Porter
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Heerdegen @ 2019-09-14 17:07 UTC (permalink / raw)
  To: Emacs Development

Hello,

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
`font-lock-extend-region-functions').

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
approach?

TIA,

Michael.



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-10-14  4:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-14 17:07 Limits of multiline font-lock Michael Heerdegen
2019-09-15 12:28 ` Stefan Monnier
2019-09-15 23:13   ` Michael Heerdegen
2019-09-16 19:00     ` Stefan Monnier
2019-09-18  3:23       ` Michael Heerdegen
2019-09-18 21:13 ` Adam Porter
2019-09-19  2:05   ` Michael Heerdegen
2019-09-19  2:36     ` Adam Porter
2023-10-07  7:30     ` Adam Porter
2023-10-14  4:06       ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).