]> git.eshelyaron.com Git - emacs.git/commitdiff
Try to avoid redisplaying all frames when creating a new one
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 30 Sep 2015 14:00:13 +0000 (10:00 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 30 Sep 2015 14:00:13 +0000 (10:00 -0400)
* src/xfns.c (x_set_menu_bar_lines, x_change_tool_bar_height):
* src/xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
(Finternal_set_lisp_face_attribute, update_face_from_frame_parameter):
* src/frame.c (x_set_screen_gamma): Set the specific frame's
`redisplay' bit rather than windows_or_buffers_changed.

* src/window.c (apply_window_adjustment): Remove redundant setting of
windows_or_buffers_changed.

* src/xdisp.c (redisplay_internal): Set the specific frame's
`redisplay' bit rather than update_mode_lines in response to
cursor_type_changed.
(syms_of_xdisp): Use hash-tables for redisplay_*_cause tables.
(AINC): Adjust accordingly.

src/frame.c
src/window.c
src/xdisp.c
src/xfaces.c
src/xfns.c

index 121c55fdb20f105a4725a86039c0914b82639597..f1a78fbdbf80f63dc616d7633bad3382ac4d1fa1 100644 (file)
@@ -3539,8 +3539,8 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
            (f, bgcolor, Qnil);
     }
 
-  clear_face_cache (true);
-  windows_or_buffers_changed = 70;
+  clear_face_cache (true);     /* FIXME: Why of all frames?  */
+  fset_redisplay (f);
 }
 
 
index d61f586a7fb0f4e46e34b6ae259f5e128bef5b10..6d06e5480941536e6b765f351f25c516199277ab 100644 (file)
@@ -6609,7 +6609,6 @@ apply_window_adjustment (struct window *w)
   eassert (w);
   clear_glyph_matrix (w->current_matrix);
   w->window_end_valid = false;
-  windows_or_buffers_changed = 30;
   wset_redisplay (w);
   adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w)));
 }
index 863d891c2de64727c7a77e1dd6bf3cb047a54976..259c36373bf5b336e8abecbaa274283ce88d1130 100644 (file)
@@ -13432,7 +13432,7 @@ redisplay_internal (void)
          /* If cursor type has been changed on the frame
             other than selected, consider all frames.  */
          if (f != sf && f->cursor_type_changed)
-           update_mode_lines = 31;
+           fset_redisplay (f);
        }
       clear_desired_matrices (f);
     }
@@ -13530,9 +13530,12 @@ redisplay_internal (void)
   consider_all_windows_p = (update_mode_lines
                            || windows_or_buffers_changed);
 
-#define AINC(a,i) \
-  if (VECTORP (a) && i >= 0 && i < ASIZE (a) && INTEGERP (AREF (a, i))) \
-    ASET (a, i, make_number (1 + XINT (AREF (a, i))))
+#define AINC(a,i)                                                      \
+  {                                                                    \
+    Lisp_Object entry = Fgethash (make_number (i), a, make_number (0));        \
+    if (INTEGERP (entry))                                              \
+      Fputhash (make_number (i), make_number (1 + XINT (entry)), a);   \
+  }
 
   AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed);
   AINC (Vredisplay__mode_lines_cause, update_mode_lines);
@@ -31387,13 +31390,11 @@ display table takes effect; in this case, Emacs does not consult
 
   DEFVAR_LISP ("redisplay--all-windows-cause", Vredisplay__all_windows_cause,
               doc: /*  */);
-  Vredisplay__all_windows_cause
-    = Fmake_vector (make_number (100), make_number (0));
+  Vredisplay__all_windows_cause = Fmake_hash_table (0, NULL);
 
   DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause,
               doc: /*  */);
-  Vredisplay__mode_lines_cause
-    = Fmake_vector (make_number (100), make_number (0));
+  Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL);
 }
 
 
index 40713f167ffc5e4a62b29cfd6a81c3c4286391e9..8cf0b4277994b47b851103007917e2ba5aa9bef0 100644 (file)
@@ -631,7 +631,7 @@ free_frame_faces (struct frame *f)
 /* Clear face caches, and recompute basic faces for frame F.  Call
    this after changing frame parameters on which those faces depend,
    or when realized faces have been freed due to changing attributes
-   of named faces. */
+   of named faces.  */
 
 void
 recompute_basic_faces (struct frame *f)
@@ -2528,10 +2528,15 @@ Value is a vector of face attributes.  */)
   if (NILP (Fget (face, Qface_no_inherit)))
     {
       if (f)
-       f->face_change = 1;
+       {
+         f->face_change = true;
+         fset_redisplay (f);
+       }
       else
-       face_change = true;
-      windows_or_buffers_changed = 54;
+       {
+         face_change = true;
+         windows_or_buffers_changed = 54;
+       }
     }
 
   eassert (LFACEP (lface));
@@ -2613,10 +2618,15 @@ The value is TO.  */)
   if (NILP (Fget (to, Qface_no_inherit)))
     {
       if (f)
-       f->face_change = 1;
+       {
+         f->face_change = true;
+         fset_redisplay (f);
+       }
       else
-       face_change = true;
-      windows_or_buffers_changed = 55;
+       {
+         face_change = true;
+         windows_or_buffers_changed = 55;
+       }
     }
 
   return to;
@@ -3120,7 +3130,7 @@ FRAME 0 means change the face on all frames, and change the default
       && NILP (Fequal (old_value, value)))
     {
       f->face_change = true;
-      windows_or_buffers_changed = 56;
+      fset_redisplay (f);
     }
 
   if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
@@ -3293,7 +3303,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
       && NILP (Fget (face, Qface_no_inherit)))
     {
       f->face_change = true;
-      windows_or_buffers_changed = 57;
+      fset_redisplay (f);
     }
 }
 
index d6a3d76e9483e22ba32d3e5fea365c4e55b98350..fc6111c4fabdc8e59db59a100569eee46702a1ca 100644 (file)
@@ -1041,7 +1041,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
     nlines = 0;
 
   /* Make sure we redisplay all windows in this frame.  */
-  windows_or_buffers_changed = 59;
+  fset_redisplay (f);
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   FRAME_MENU_BAR_LINES (f) = 0;
@@ -1160,8 +1160,7 @@ x_change_tool_bar_height (struct frame *f, int height)
   Lisp_Object fullscreen;
 
   /* Make sure we redisplay all windows in this frame.  */
-  windows_or_buffers_changed = 60;
-
+  fset_redisplay (f);
 
   /* Recalculate tool bar and frame text sizes.  */
   FRAME_TOOL_BAR_HEIGHT (f) = height;