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:30:41 +0200

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: Michael Heerdegen <michael_heerdegen@web.de>, emacs-devel@gnu.org
> Date: Thu, 12 Jan 2023 14:26:13 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> 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.
> 
> Yet, there is observable difference.
> AFAIK, helm does use `while-no-input' and I've seen helm being
> non-blocking on functions that are not designed with interrupts in mind.
> I suspect that you are missing something.

Maybe you are missing what I wrote about testing quit-flag?

> More complex fontification may stumble on _editing_ long lines - if
> fontification is performed line-by-line, long lines can slow down the
> performance significantly (which is a known problem). It is often
> a reasonable trade-off to defer re-fontification while editing a long
> line and re-fontify it later. I have stumbled upon this issue myself in
> my parser-based fontification for Org.

It's a trade-off: you assume that users don't want to see the
fontifications change in near real-time when editing long lines, but
that is just an assumption, not necessarily true.



reply via email to

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