From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: JD Smith <jdtsmith@gmail.com>
Cc: dmitry@gutov.dev, 71345@debbugs.gnu.org
Subject: bug#71345: Feature: unleash font-lock's secret weapon; handle Qfontified = non-nil
Date: Mon, 03 Jun 2024 21:44:36 -0400 [thread overview]
Message-ID: <jwvtti9lcf0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <1F2B8726-7594-494F-AB9D-08C48B7BCC43@gmail.com> (JD Smith's message of "Mon, 3 Jun 2024 17:14:49 -0400")
> Thanks. Very interesting approach, recycling the existing Qfontified
> handler. I wonder though, if you have several different unrelated functions
> calling `jit-lock-flush' with different FONTIFICATION-FUNCTION's prior to
> jit-lock-fontify-now running on a region, won't they step on each other?
Not if `jit-lock.el` handles it correctly, no.
> I.e it seems that you would need to look for existing
> jit-lock-already-fontified+fontified=nil properties over the region
> mentioned in jit-lock-flush and subtract the passed FONTIFICATION-FUNCTION
> from the various values already found there.
Yes, of course.
> Of course you'd also need to handle the case where you "subtract it
> all the way to nil".
I don't think you'd need to do anything special for this case.
> That starts to sound like a lot of property slinging, which might even
> dominate the work done.
Indeed, this amount of work could become significant. It's my main
worry, but I don't have a clear feel for how serious it would be
in practice.
We could try and unify `fontified` and `jit-lock-already-fontified` by
having a `fontified-done-value` variable and making the redisplay call
jit-lock whenever `fontified` has a value that's not-eq from
`fontified-done-value`.
So jit-lock would set `fontified-done-value` to the list of backends.
> I imagine that the functions may also need a way to opt-out of "deferred
> contextual refontification", for example if they add some other
> properties/overlays orthogonal to face.
`jit-lock.el` already has that info (it's the second arg to
`jit-lock-register`), but it currently doesn't keep track of it
individually for each backend.
Stefan
next prev parent reply other threads:[~2024-06-04 1:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 16:35 bug#71345: Feature: unleash font-lock's secret weapon; handle Qfontified = non-nil JD Smith
2024-06-03 16:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-03 21:14 ` JD Smith
2024-06-04 1:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-06-04 12:08 ` JD Smith
2024-06-04 14:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 15:38 ` JD Smith
2024-06-04 21:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 22:41 ` JD Smith
2024-06-05 11:29 ` Eli Zaretskii
2024-06-05 14:02 ` JD Smith
2024-06-05 14:53 ` Eli Zaretskii
2024-06-05 15:52 ` JD Smith
2024-06-05 17:00 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-05 17:24 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-05 11:24 ` Eli Zaretskii
2024-06-05 14:05 ` JD Smith
2024-06-05 16:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-05 16:38 ` Eli Zaretskii
2024-06-05 16:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-05 17:52 ` Eli Zaretskii
2024-06-05 18:13 ` JD Smith
2024-06-07 3:27 ` JD Smith
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=jwvtti9lcf0.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=71345@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=jdtsmith@gmail.com \
--cc=monnier@iro.umontreal.ca \
/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.