diff src/dispnew.c @ 71771:c6e0c9217129

(Fredisplay): Add FORCE argument to force redisplay when input is available. Fix test for redisplay_dont_pause non-nil. Specbind redisplay-dont-pause to t if FORCE non-nil.
author Kim F. Storm <storm@cua.dk>
date Mon, 10 Jul 2006 23:52:38 +0000
parents 1055c0769159
children 5770bf2e36bd
line wrap: on
line diff
--- a/src/dispnew.c	Mon Jul 10 23:03:59 2006 +0000
+++ b/src/dispnew.c	Mon Jul 10 23:52:38 2006 +0000
@@ -6532,19 +6532,26 @@
 }
 
 
-DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 0, 0,
-       doc: /* Perform redisplay.
-If input is available before this starts, redisplay is preempted
-unless `redisplay-dont-pause' is non-nil.  */)
-     ()
+DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 1, 0,
+       doc: /* Perform redisplay if no input is available.
+If optional arg FORCE is non-nil, perform a full redisplay even if
+input is available.  */)
+     (force)
+  Lisp_Object force;
 {
+  int count;
+
   swallow_events (Qt);
   if ((detect_input_pending_run_timers (Qt)
-       && NILP (Qredisplay_dont_pause))
+       && NILP (force) && !redisplay_dont_pause)
       || !NILP (Vexecuting_kbd_macro))
     return Qnil;
 
+  count = SPECPDL_INDEX ();
+  if (!NILP (force) && !redisplay_dont_pause)
+    specbind (Qredisplay_dont_pause, Qt);
   redisplay_preserve_echo_area (2);
+  unbind_to (count, Qnil);
   return Qt;
 }