unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Subject: Re: Partly deferred font-locking?
Date: Thu, 12 Jan 2023 14:14:15 +0100	[thread overview]
Message-ID: <87o7r3gajc.fsf@web.de> (raw)
In-Reply-To: 83zgaolu7o.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

> My point is that your example is the exception rather than the rule.
> Fontifications almost never access files or do any other fancy stuff
> like that.  At least AFAIK.

Yes yes, all good.

But I missed a feature like this for several times.  One application is
syntax-based highlighting of el-search matches, for example.  Or a
hi-lock like thing but not restricted to simple regexps.

I implemented the el-search hi-lock library more or less without
font-lock, but were reinventing parts of it.

Maybe there would be more use cases if Emacs would support this kind of
highlighting, I don't know.


If you wanted to add some more expensive on-the-fly highlighting, how
would you do it?

Currently, one can't use font-lock directly: when the additional deferred
highlighting doesn't happen for a buffer chunk but normal font-locking
was performed, the deferred highlighting would not be triggered again
when that buffer area gets visible again.
So I think I would have to remember which parts of the buffer where
treated by the deferred highlighting by myself, I would have to keep
that information in an additional variable.  That feels a bit odd
since this is one of the things that font-lock naturally does.
I need to reinvent parts of font-lock.


Michael.




  reply	other threads:[~2023-01-12 13:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 17:15 Partly deferred font-locking? Michael Heerdegen
2023-01-11 17:43 ` [External] : " Drew Adams
2023-01-11 18:33   ` Michael Heerdegen
2023-01-11 18:38     ` Drew Adams
2023-01-11 18:49       ` Drew Adams
2023-01-11 19:31         ` Michael Heerdegen
2023-01-11 17:45 ` Eli Zaretskii
2023-01-11 18:36   ` Michael Heerdegen
2023-01-11 19:58     ` Eli Zaretskii
2023-01-12 13:14       ` Michael Heerdegen [this message]
2023-01-12 13:45         ` Eli Zaretskii
2023-01-12 14:00           ` Michael Heerdegen
2023-01-12 14:13             ` Eli Zaretskii
2023-01-12 14:26               ` Ihor Radchenko
2023-01-12 14:30                 ` Ihor Radchenko
2023-01-12 14:36                   ` Eli Zaretskii
2023-01-12 14:44                     ` Ihor Radchenko
2023-01-12 15:11                       ` Eli Zaretskii
2023-01-12 15:40                         ` Ihor Radchenko
2023-01-12 14:30                 ` Eli Zaretskii
2023-01-12 14:36                   ` Ihor Radchenko
2023-01-12 14:38                   ` Michael Heerdegen
2023-01-12 14:33               ` Michael Heerdegen
2023-01-12 15:51                 ` Eli Zaretskii
2023-01-12 16:02                   ` 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=87o7r3gajc.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 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).