Subject: Re: bug#52298: 29.0.50; Frequent redisplay cycles induced by c-type-finder-timer-func timer in CC Mode

From: Alan Mackenzie <[email-masked]>
Date: Sun, 12 Dec 2021 19:05:45 +0000

Hello, Eli.

On Sun, Dec 12, 2021 at 11:15:34 +0200, Eli Zaretskii wrote:
> > Date: Sun, 12 Dec 2021 08:58:08 +0000
> > Cc: [email-masked], [email-masked]
> > From: Alan Mackenzie <[email-masked]>

> > > > So, I suggest I write a commit message and commit that patch.

> > > Which patch?  I'm afraid I'm missing something here.

> > This one, the one that should prevent excessive incursions into the
> > redisplay engine when a text property gets set whilst
> > inhibit-modification-hooks is set:

> No, this cannot be used as-is, because when face properties change, we
> do want redisplay to take notice, of course.  I guess that's why
> inhibit-modification-hooks doesn't prevent incrementing the
> modification tick when text properties are changed in the first place:
> it's not feasible to know which text properties affect the display and
> which don't.  No one expected text properties irrelevant to display to
> be put on buffer text with such high frequency.

Yes, that makes sense, thanks.  Maybe I'll put a comment in there saying
that.

> If you don't have any other ideas, I guess we will have to live with
> this.  Too bad.

> (Sorry, but I like CC Mode less and less with every Emacs release, due
> to changes like this one.)

This particular feature simply hasn't worked out well.  If the
background scanning were to complete in a few seconds, it wouldn't be
too bad.  But nearly two minutes on a modern (well, 4½ yo) machine for
just one buffer, with the annoyance of the "stuttering", is not worth
the gain.

What we have is effectively the entire buffer getting half-fontified in
the background.  That's not what JIT fontification is supposed to be
about.

So, in the next few days sometime, I will revert most of this change.  A
useful and harmless piece of it (fontifying a newly found type
throughout the buffer when it is encountered in "normal" jit
fontification), I plan to leave in.  That will get rid of that timer and
all the background scanning it triggered.

-- 
Alan Mackenzie (Nuremberg, Germany).