From: Adam Porter <adam@alphapapa.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: emacs-devel@gnu.org
Subject: Re: Limits of multiline font-lock
Date: Sat, 7 Oct 2023 02:30:21 -0500 [thread overview]
Message-ID: <77114a4e-a487-40ce-9887-ba46d7b096bd@alphapapa.net> (raw)
In-Reply-To: <87ftktghwm.fsf@web.de>
Hi Michael,
Please forgive the "blast from the past"; going through some old mail
from the list I saw this message of yours that I missed.
On 9/18/19 21:05, Michael Heerdegen wrote:
> Adam Porter <adam@alphapapa.net> writes:
>
>> You might be interested in this package I published recently. It
>> implements depth-based syntax highlighting for Lisp and some other
>> languages.
>>
>> https://github.com/alphapapa/prism.el
>
> Nice. Could it go to Gnu Elpa?
Yes, I think I will submit it to GNU ELPA one of these days. It's more
mature now than it was then.
>> However, I have discovered a performance issue in the case of sexps that
>> span large portions of the buffer (e.g. in my init files, I have some
>> large use-package forms that contain many functions and span hundreds of
>> lines). If I could solve that, it would be great, but it works fine for
>> most code.
>
> If you use `font-lock-extend-region-functions', all of font-lock uses
> the extended region, right? I guess basing your functionality on
> jit-lock-register could be better. If finding the beginning-of-defun
> and identifying the levels is what causes the main cost, it wouldn't
> help much, however.
IIRC that performance issue turned out to be a bug elsewhere in the
code; once solved, the issue with large forms spanning many lines was no
longer a problem.
> My use case is a bit simpler since I only have to deal with Lisp. What
> modes does prism support btw? What are reasons why some languages are
> not supported?
Prism has two modes, one for whitespace-significant languages and one
for all others. It seems to generally work well, especially since some
recent bug fixes.
The liability, to the extent that there is one, is that syntax tables
can affect how delimiters and comments are detected, and some major
modes may not use them in a way that makes such detection possible, e.g.
using Emacs regexps' syntax types and syntax-ppss parsing.
Now that treesitter is in Emacs, I'm guessing that it might be helpful
as a backend for some languages, so I may look into that in the future.
next prev parent reply other threads:[~2023-10-07 7:30 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
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 [this message]
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=77114a4e-a487-40ce-9887-ba46d7b096bd@alphapapa.net \
--to=adam@alphapapa.net \
--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 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.