From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Emacs Development <emacs-devel@gnu.org>
Subject: Re: Limits of multiline font-lock
Date: Sun, 15 Sep 2019 08:28:21 -0400 [thread overview]
Message-ID: <jwvv9ttdaax.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87impuu7qy.fsf@web.de> (Michael Heerdegen's message of "Sat, 14 Sep 2019 19:07:17 +0200")
> 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.
I think before deciding which tools to use, I think you need to figure
out how you want to solve the fundamental difficulty:
- we're inside an arbitrary buffer with your new el-search-hi-lock
functionality enabled for a particular pattern.
- let's assume for now that currently there's no match anywhere.
- then the user makes an edit at line N which makes the pattern match
on lines M to M' (M < N and M' > N).
How do you plan on finding this match?
- You can scan the whole buffer from point-min, but that might be too
costly (tho maybe it's OK if you do it from an idle timer).
- Or you can add limits like "we'll only look for it between N-5 and
N+5" and we don't care if we don't notice new "hard to find" matches.
- Or you can rely on the earlier scans having noted that the text between M and N
matches the beginning of the pattern and hence only need to check whether,
after the edit, the new text starting at N matches "the rest of the
pattern".
- ...
Stefan
next prev parent reply other threads:[~2019-09-15 12:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-14 17:07 Limits of multiline font-lock Michael Heerdegen
2019-09-15 12:28 ` Stefan Monnier [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvv9ttdaax.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=michael_heerdegen@web.de \
/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 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).