emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Partly deferred font-locking?


From: Eli Zaretskii
Subject: Re: Partly deferred font-locking?
Date: Thu, 12 Jan 2023 16:13:06 +0200

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Thu, 12 Jan 2023 15:00:43 +0100
> 
> > If so, you'd need to change the 'fontified' property to
> > have more than just a boolean value, and you'd need a special timer
> > which examined the 'fontified' property and applied more highlighting
> > if the value says it wasn't applied yet.
> 
> That would have to be done in Emacs, not in my code, right?

Depends on whether the additional highlighting will be part of
jit-lock.el or not.  The display engine only cares whether the value
of 'fontified' is nil or not.

> > Please note that expensive highlighting might make Emacs less
> > responsive.
> 
> So far I'm always using `while-no-input' and code that doesn't cause
> trouble when it gets interrupted.  With that approach I had been able to
> avoid this issue nearly completely.

while-no-input is not a way to interrupt an on-going calculation,
because it requires Emacs to check whether any input arrived, and
Emacs only does that when it's idle.  IOW, if some fontification is
expensive and doesn't itself test quit-flag, you cannot interrupt it
in the middle by wrapping it with while-no-input.  You are
specifically talking about accessing the filesystem, which means you
will call some file I/O C API, and those won't be interrupted.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]