]> git.eshelyaron.com Git - emacs.git/commitdiff
(redisplay): Call clear_face_cache instead
authorRichard M. Stallman <rms@gnu.org>
Fri, 14 Oct 1994 05:20:15 +0000 (05:20 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 14 Oct 1994 05:20:15 +0000 (05:20 +0000)
of clear_face_vector.  Do it at most once per 1000 redisplays.

src/xdisp.c

index 5d4c579b9058c968e0fa305e967259cd9ccdf8b0..cbcad61400e22b962059d693cc7491adb3054d4e 100644 (file)
@@ -545,6 +545,10 @@ prepare_menu_bars ()
 
 static int do_verify_charstarts;
 
+/* Counter is used to clear the face cache
+   no more than once ever 1000 redisplays.  */
+static int clear_face_cache_count;
+
 void
 redisplay ()
 {
@@ -732,14 +736,20 @@ redisplay ()
   this_line_bufpos = 0;
   all_windows |= buffer_shared > 1;
 
+  clear_face_cache_count++;
+
   if (all_windows)
     {
       Lisp_Object tail, frame;
 
 #ifdef HAVE_X_WINDOWS
-      /* Since we're doing a thorough redisplay, we might as well
-        recompute all our display faces.  */
-      clear_face_vector ();
+      /* Clear the face cache, only when we do a full redisplay
+        and not too often either.  */
+      if (clear_face_cache_count > 1000)
+       {
+         clear_face_cache ();
+         clear_face_cache_count = 0;
+       }
 #endif
 
       /* Recompute # windows showing selected buffer.