From: Michael Heerdegen <michael_heerdegen@web.de>
To: Emacs Development <emacs-devel@gnu.org>
Subject: Limits of multiline font-lock
Date: Sat, 14 Sep 2019 19:07:17 +0200 [thread overview]
Message-ID: <87impuu7qy.fsf@web.de> (raw)
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.
next reply other threads:[~2019-09-14 17:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-14 17:07 Michael Heerdegen [this message]
2019-09-15 12:28 ` Limits of multiline font-lock 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87impuu7qy.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.