emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-fontify-block


From: Eli Zaretskii
Subject: Re: font-lock-fontify-block
Date: Thu, 11 Mar 2021 22:10:31 +0200

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: larsi@gnus.org,  emacs-devel@gnu.org
> Date: Thu, 11 Mar 2021 12:52:27 -0500
> 
> Do you have some general idea of what are the most common reasons for
> the temporary mis-fontification?
> 
> AFAIK usually misfontifications aren't temporary unless they're linked
> to some multiline element, most commonly an unclosed string or comment
> and those should get fixed automatically after a short delay.

Probably.  But also when fontification is highly context-dependent, I
think.

> So is it the case that the cases where you needed `M-o M-o` would
> fix themselves after a short delay anyway (I'm OK with keeping such
> a command for the case you don't want to wait, I'm just trying to
> understand what it is that `M-o M-o` corrects).

No, in most cases where I used it, the delay isn't short.  More like
infinite.

> Would you be OK with the idea of deprecating the use of
> `font-lock-fontify-block' for the specific case where font-lock is
> not enabled?

I only ever use it in that case to _remove_ the faces from text yanked
from a fontified buffer.  So that's another important use case for
M-o M-o.

> Also, I suspect that for your use case, we could have a general
> "refresh" command, which just calls `font-lock-flush`, which would not
> depend on the ill-defined notion of "block" (and wouldn't mess with the
> mark).

I'd have to use it for a while to have an opinion.



reply via email to

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