Subject: Re: bug#79306: Broken follow-mode

From: Stefan Monnier <[email-masked]>
Date: Thu, 04 Sep 2025 00:58:34 -0400

> Is it allowed to perform redisplay from pre-redisplay-function?

Yeah, I think `pre-redisplay-function` is still early enough that it
happens before we start messing with the state, so it's safe.  I guess
that means it can be called with a normal `call` rather than
`safe_call`.

> If so, we need to refine the above test, or maybe disable it when we
> call pre-redisplay-function.

Agreed.  Maybe with something like the patch below?

        Stefan

diff --git a/src/xdisp.c b/src/xdisp.c
index 89561d750b6..e486eb177c1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14059,7 +14059,8 @@ prepare_menu_bars (void)
 		windows = Fcons (this, windows);
 	    }
 	}
-      dsafe_calln (true, Vpre_redisplay_function, windows);
+      /* FIXME: Bind 'inhibit_quit'.  */
+      calln (true, Vpre_redisplay_function, windows);
     }
 
   /* Update all frame titles based on their buffer names, etc.  We do