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 08:58:08 +0000

Hello, Eli.

On Sat, Dec 11, 2021 at 20:21:51 +0200, Eli Zaretskii wrote:
> > Date: Sat, 11 Dec 2021 17:04:28 +0000
> > Cc: [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:

diff --git a/src/textprop.c b/src/textprop.c
index d7d6a66923..d91b8624ef 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -85,10 +85,13 @@ modify_text_properties (Lisp_Object buffer,
Lisp_Object start, Lisp_Object end)
 
   prepare_to_modify_buffer_1 (b, e, NULL);
 
-  BUF_COMPUTE_UNCHANGED (buf, b - 1, e);
-  if (MODIFF <= SAVE_MODIFF)
-    record_first_change ();
-  modiff_incr (&MODIFF);
+  if (!inhibit_modification_hooks)
+    {
+      BUF_COMPUTE_UNCHANGED (buf, b - 1, e);
+      if (MODIFF <= SAVE_MODIFF)
+       record_first_change ();
+      modiff_incr (&MODIFF);
+    }
 
   bset_point_before_scroll (current_buffer, Qnil);
 
-- 
Alan Mackenzie (Nuremberg, Germany).