emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115007: * src/xdisp.c (syms_of_xdisp): New vars red


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115007: * src/xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and
Date: Wed, 06 Nov 2013 18:41:37 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115007
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-11-06 13:41:31 -0500
message:
  * src/xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and
  redisplay--mode-lines-cause.
  (redisplay_internal): Keep them uptodate.  Remove redundant check of
  buffer_shared_and_changed.
  * *.[chm]: Number every assignment to update_mode_lines so we
  can track why it is set.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/buffer.c                   buffer.c-20091113204419-o5vbwnq5f7feedwu-264
  src/commands.h                 commands.h-20091113204419-o5vbwnq5f7feedwu-215
  src/dosfns.c                   dosfns.c-20091113204419-o5vbwnq5f7feedwu-653
  src/fileio.c                   fileio.c-20091113204419-o5vbwnq5f7feedwu-210
  src/frame.c                    frame.c-20091113204419-o5vbwnq5f7feedwu-243
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  src/macros.c                   macros.c-20091113204419-o5vbwnq5f7feedwu-217
  src/nsfns.m                    nsfns.m-20091113204419-o5vbwnq5f7feedwu-8741
  src/process.c                  process.c-20091113204419-o5vbwnq5f7feedwu-462
  src/w32fns.c                   w32fns.c-20091113204419-o5vbwnq5f7feedwu-945
  src/window.c                   window.c-20091113204419-o5vbwnq5f7feedwu-231
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
  src/xfns.c                     xfns.c-20091113204419-o5vbwnq5f7feedwu-274
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-11-06 10:14:50 +0000
+++ b/src/ChangeLog     2013-11-06 18:41:31 +0000
@@ -1,3 +1,12 @@
+2013-11-06  Stefan Monnier  <address@hidden>
+
+       * xdisp.c (syms_of_xdisp): New vars redisplay--all-windows-cause and
+       redisplay--mode-lines-cause.
+       (redisplay_internal): Keep them uptodate.  Remove redundant check of
+       buffer_shared_and_changed.
+       * *.[chm]: Number every assignment to update_mode_lines so we
+       can track why it is set.
+
 2013-11-06  Eli Zaretskii  <address@hidden>
 
        * editfns.c (Fformat_time_string): Doc fix.  (Bug#15816)

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2013-11-06 04:11:04 +0000
+++ b/src/buffer.c      2013-11-06 18:41:31 +0000
@@ -1393,7 +1393,7 @@
      smarter about updating the `*' in mode lines.  --gerd  */
   if (buffer_window_count (current_buffer))
     {
-      ++update_mode_lines;
+      update_mode_lines = 10;
       current_buffer->prevent_redisplay_optimizations_p = 1;
     }
 
@@ -1513,7 +1513,7 @@
 
   /* Catch redisplay's attention.  Unless we do this, the mode lines for
      any windows displaying current_buffer will stay unchanged.  */
-  update_mode_lines++;
+  update_mode_lines = 11;
 
   XSETBUFFER (buf, current_buffer);
   Fsetcar (Frassq (buf, Vbuffer_alist), newname);
@@ -2765,7 +2765,7 @@
 
   /* Force mode-line redisplay.  Useful here because all major mode
      commands call this function.  */
-  update_mode_lines++;
+  update_mode_lines = 12;
 
   return Qnil;
 }

=== modified file 'src/commands.h'
--- a/src/commands.h    2013-01-01 09:11:05 +0000
+++ b/src/commands.h    2013-11-06 18:41:31 +0000
@@ -36,10 +36,10 @@
    events until a non-ASCII event is acceptable as input.  */
 extern Lisp_Object unread_switch_frame;
 
-/* Nonzero if input is coming from the keyboard */
+/* Nonzero if input is coming from the keyboard.  */
 
 #define INTERACTIVE (NILP (Vexecuting_kbd_macro) && !noninteractive)
 
-/* Set this nonzero to force reconsideration of mode line. */
+/* Set this nonzero to force reconsideration of mode line.  */
 
 extern int update_mode_lines;

=== modified file 'src/dosfns.c'
--- a/src/dosfns.c      2013-01-01 09:11:05 +0000
+++ b/src/dosfns.c      2013-11-06 18:41:31 +0000
@@ -472,7 +472,7 @@
   if (EQ (name, f->title))
     return;
 
-  update_mode_lines = 1;
+  update_mode_lines = 13;
 
   fset_title (f, name);
 

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2013-11-05 07:44:14 +0000
+++ b/src/fileio.c      2013-11-06 18:41:31 +0000
@@ -4997,7 +4997,7 @@
       SAVE_MODIFF = MODIFF;
       XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
       bset_filename (current_buffer, visit_file);
-      update_mode_lines++;
+      update_mode_lines = 14;
     }
   else if (quietly)
     {

=== modified file 'src/frame.c'
--- a/src/frame.c       2013-11-06 04:11:04 +0000
+++ b/src/frame.c       2013-11-06 18:41:31 +0000
@@ -1489,7 +1489,7 @@
 
   /* Cause frame titles to update--necessary if we now have just one frame.  */
   if (!is_tooltip_frame)
-    update_mode_lines = 1;
+    update_mode_lines = 15;
 
   return Qnil;
 }
@@ -2025,7 +2025,7 @@
     }
 
   fset_name (f, name);
-  update_mode_lines = 1;
+  update_mode_lines = 16;
 }
 
 void

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2013-11-06 04:11:04 +0000
+++ b/src/keyboard.c    2013-11-06 18:41:31 +0000
@@ -821,7 +821,7 @@
     return Qnil;
 
   command_loop_level++;
-  update_mode_lines = 1;
+  update_mode_lines = 17;
 
   if (command_loop_level
       && current_buffer != XBUFFER (XWINDOW (selected_window)->contents))
@@ -848,7 +848,7 @@
     Fset_buffer (buffer);
 
   command_loop_level--;
-  update_mode_lines = 1;
+  update_mode_lines = 18;
 }
 
 

=== modified file 'src/macros.c'
--- a/src/macros.c      2013-07-16 21:35:45 +0000
+++ b/src/macros.c      2013-11-06 18:41:31 +0000
@@ -55,7 +55,7 @@
 Non-nil arg (prefix arg) means append to last macro defined;
 this begins by re-executing that macro as if you typed it again.
 If optional second arg, NO-EXEC, is non-nil, do not re-execute last
-macro before appending to it. */)
+macro before appending to it.  */)
   (Lisp_Object append, Lisp_Object no_exec)
 {
   if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
@@ -66,7 +66,7 @@
       current_kboard->kbd_macro_buffer = xmalloc (30 * word_size);
       current_kboard->kbd_macro_bufsize = 30;
     }
-  update_mode_lines++;
+  update_mode_lines = 19;
   if (NILP (append))
     {
       if (current_kboard->kbd_macro_bufsize > 200)
@@ -138,7 +138,7 @@
 end_kbd_macro (void)
 {
   kset_defining_kbd_macro (current_kboard, Qnil);
-  update_mode_lines++;
+  update_mode_lines = 20;
   kset_last_kbd_macro
     (current_kboard,
      make_event_array ((current_kboard->kbd_macro_end

=== modified file 'src/nsfns.m'
--- a/src/nsfns.m       2013-11-06 04:11:04 +0000
+++ b/src/nsfns.m       2013-11-06 18:41:31 +0000
@@ -451,8 +451,8 @@
 
   str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)];
 
-  if ([[view window] miniwindowTitle] &&
-      ! [[[view window] miniwindowTitle] isEqualToString: str])
+  if ([[view window] miniwindowTitle]
+      && ! [[[view window] miniwindowTitle] isEqualToString: str])
     [[view window] setMiniwindowTitle: str];
 
 }
@@ -469,7 +469,7 @@
       /* If we're switching from explicit to implicit, we had better
          update the mode lines and thereby update the title.  */
       if (f->explicit_name && NILP (name))
-        update_mode_lines = 1;
+        update_mode_lines = 21;
 
       f->explicit_name = ! NILP (name);
     }
@@ -477,7 +477,7 @@
     return;
 
   if (NILP (name))
-    name = build_string([ns_app_name UTF8String]);
+    name = build_string ([ns_app_name UTF8String]);
   else
     CHECK_STRING (name);
 
@@ -487,7 +487,7 @@
 
   fset_name (f, name);
 
-  /* title overrides explicit name */
+  /* Title overrides explicit name.  */
   if (! NILP (f->title))
     name = f->title;
 
@@ -534,7 +534,7 @@
   if (EQ (name, f->title))
     return;
 
-  update_mode_lines = 1;
+  update_mode_lines = 22;
 
   fset_title (f, name);
 

=== modified file 'src/process.c'
--- a/src/process.c     2013-11-05 05:32:19 +0000
+++ b/src/process.c     2013-11-06 18:41:31 +0000
@@ -5246,7 +5246,7 @@
       else
        set_marker_both (p->mark, p->buffer, PT, PT_BYTE);
 
-      update_mode_lines++;
+      update_mode_lines = 23;
 
       /* Make sure opoint and the old restrictions
         float ahead of any new text just as point would.  */
@@ -6390,7 +6390,7 @@
        }
     } /* end for */
 
-  update_mode_lines++;  /* In case buffers use %s in mode-line-format.  */
+  update_mode_lines = 24;  /* In case buffers use %s in mode-line-format.  */
   UNGCPRO;
 }
 

=== modified file 'src/w32fns.c'
--- a/src/w32fns.c      2013-11-06 04:11:04 +0000
+++ b/src/w32fns.c      2013-11-06 18:41:31 +0000
@@ -1740,7 +1740,7 @@
       /* If we're switching from explicit to implicit, we had better
         update the mode lines and thereby update the title.  */
       if (f->explicit_name && NILP (name))
-       update_mode_lines = 1;
+       update_mode_lines = 25;
 
       f->explicit_name = ! NILP (name);
     }
@@ -1808,7 +1808,7 @@
   if (EQ (name, f->title))
     return;
 
-  update_mode_lines = 1;
+  update_mode_lines = 26;
 
   fset_title (f, name);
 

=== modified file 'src/window.c'
--- a/src/window.c      2013-11-06 04:11:04 +0000
+++ b/src/window.c      2013-11-06 18:41:31 +0000
@@ -2639,7 +2639,7 @@
                mark_window_display_accurate (window, 0);
                w->update_mode_line = 1;
                XBUFFER (obj)->prevent_redisplay_optimizations_p = 1;
-               ++update_mode_lines;
+               update_mode_lines = 27;
                best_window = window;
              }
            break;
@@ -3279,7 +3279,7 @@
   if (NILP (object))
     {
       windows_or_buffers_changed = 29;
-      update_mode_lines++;
+      update_mode_lines = 28;
       return Qt;
     }
 
@@ -3290,7 +3290,7 @@
       w->update_mode_line = 1;
       if (BUFFERP (w->contents))
        XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;
-      ++update_mode_lines;
+      update_mode_lines = 29;
       return Qt;
     }
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-11-06 04:11:04 +0000
+++ b/src/xdisp.c       2013-11-06 18:41:31 +0000
@@ -10337,7 +10337,7 @@
       if (resized_p)
        {
          windows_or_buffers_changed = 42;
-         ++update_mode_lines;
+         update_mode_lines = 30;
          redisplay_internal ();
        }
     }
@@ -12886,12 +12886,12 @@
   int polling_stopped_here = 0;
   Lisp_Object tail, frame;
 
-  /* Non-zero means redisplay has to consider all windows on all
-     frames.  Zero means, only selected_window is considered.  */
-  int consider_all_windows_p;
+  /* True means redisplay has to consider all windows on all
+     frames.  False, only selected_window is considered.  */
+  bool consider_all_windows_p;
 
-  /* Non-zero means redisplay has to redisplay the miniwindow.  */
-  int update_miniwindow_p = 0;
+  /* True means redisplay has to redisplay the miniwindow.  */
+  bool update_miniwindow_p = false;
 
   TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p));
 
@@ -12984,7 +12984,7 @@
          /* 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++;
+           update_mode_lines = 31;
        }
       clear_desired_matrices (f);
     }
@@ -13004,8 +13004,8 @@
   if (NILP (Vmemory_full))
     prepare_menu_bars ();
 
-  if (windows_or_buffers_changed)
-    update_mode_lines++;
+  if (windows_or_buffers_changed & !update_mode_lines)
+    update_mode_lines = 32;
 
   reconsider_clip_changes (w);
 
@@ -13018,7 +13018,7 @@
        {
          w->update_mode_line = 1;
          if (buffer_shared_and_changed ())
-           update_mode_lines++;
+           update_mode_lines = 33;
        }
 
       if (mode_line_update_needed (w))
@@ -13031,7 +13031,10 @@
   /* If specs for an arrow have changed, do thorough redisplay
      to ensure we remove any arrow that should no longer exist.  */
   if (overlay_arrows_changed_p ())
-    consider_all_windows_p = windows_or_buffers_changed = 49;
+    {
+      consider_all_windows_p = true;
+      windows_or_buffers_changed = 49;
+    }
 
   /* Normally the message* functions will have already displayed and
      updated the echo area, but the frame may have been trashed, or
@@ -13049,7 +13052,7 @@
       int window_height_changed_p = echo_area_display (0);
 
       if (message_cleared_p)
-       update_miniwindow_p = 1;
+       update_miniwindow_p = true;
 
       must_finish = 1;
 
@@ -13062,8 +13065,8 @@
 
       if (window_height_changed_p)
        {
-         consider_all_windows_p = 1;
-         ++update_mode_lines;
+         consider_all_windows_p = true;
+         update_mode_lines = 34;
          windows_or_buffers_changed = 50;
 
          /* If window configuration was changed, frames may have been
@@ -13083,9 +13086,9 @@
         since only the current frame needs to be considered.  This function
         needs to be rewritten with two variables, consider_all_windows and
         consider_all_frames.  */
-      consider_all_windows_p = 1;
+      consider_all_windows_p = true;
       windows_or_buffers_changed = 51;
-      ++update_mode_lines;
+      update_mode_lines = 35;
 
       /* If window configuration was changed, frames may have been
         marked garbaged.  Clear them or we will experience
@@ -13093,6 +13096,24 @@
       clear_garbaged_frames ();
     }
 
+  if (VECTORP (Vredisplay__all_windows_cause)
+      && windows_or_buffers_changed >= 0
+      && windows_or_buffers_changed < ASIZE (Vredisplay__all_windows_cause)
+      && INTEGERP (AREF (Vredisplay__all_windows_cause,
+                        windows_or_buffers_changed)))
+    ASET (Vredisplay__all_windows_cause, windows_or_buffers_changed,
+         make_number (1 + XINT (AREF (Vredisplay__all_windows_cause,
+                                      windows_or_buffers_changed))));
+
+  if (VECTORP (Vredisplay__mode_lines_cause)
+      && update_mode_lines >= 0
+      && update_mode_lines < ASIZE (Vredisplay__mode_lines_cause)
+      && INTEGERP (AREF (Vredisplay__mode_lines_cause,
+                        update_mode_lines)))
+    ASET (Vredisplay__mode_lines_cause, update_mode_lines,
+         make_number (1 + XINT (AREF (Vredisplay__mode_lines_cause,
+                                      update_mode_lines))));
+
   /* Optimize the case that only the line containing the cursor in the
      selected window has changed.  Variables starting with this_ are
      set in display_line and record information about the line
@@ -13294,7 +13315,6 @@
     }
 
   CHARPOS (this_line_start_pos) = 0;
-  consider_all_windows_p |= buffer_shared_and_changed ();
   ++clear_face_cache_count;
 #ifdef HAVE_WINDOW_SYSTEM
   ++clear_image_cache_count;
@@ -13473,7 +13493,7 @@
         matrices of some windows are not valid.  */
       if (!WINDOW_FULL_WIDTH_P (w)
          && !FRAME_WINDOW_P (XFRAME (w->frame)))
-       update_mode_lines = 1;
+       update_mode_lines = 36;
     }
   else
     {
@@ -15337,7 +15357,7 @@
        }
       else if ((w != XWINDOW (minibuf_window)
                || minibuf_level == 0)
-              /* When buffer is nonempty, redisplay window normally. */
+              /* When buffer is nonempty, redisplay window normally.  */
               && BUF_Z (XBUFFER (w->contents)) == BUF_BEG (XBUFFER 
(w->contents))
               /* Quail displays non-mini buffers in minibuffer window.
                  In that case, redisplay the window normally.  */
@@ -29735,6 +29755,16 @@
   DEFVAR_LISP ("debug-on-message", Vdebug_on_message,
               doc: /* If non-nil, debug if a message matching this regexp is 
displayed.  */);
   Vdebug_on_message = Qnil;
+
+  DEFVAR_LISP ("redisplay--all-windows-cause", Vredisplay__all_windows_cause,
+              doc: /*  */);
+  Vredisplay__all_windows_cause
+    = Fmake_vector (make_number (100), make_number (0));
+
+  DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause,
+              doc: /*  */);
+  Vredisplay__mode_lines_cause
+    = Fmake_vector (make_number (100), make_number (0));
 }
 
 

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2013-11-06 04:11:04 +0000
+++ b/src/xfns.c        2013-11-06 18:41:31 +0000
@@ -1383,7 +1383,7 @@
       /* If we're switching from explicit to implicit, we had better
         update the mode lines and thereby update the title.  */
       if (f->explicit_name && NILP (name))
-       update_mode_lines = 1;
+       update_mode_lines = 37;
 
       f->explicit_name = ! NILP (name);
     }
@@ -1445,7 +1445,7 @@
   if (EQ (name, f->title))
     return;
 
-  update_mode_lines = 1;
+  update_mode_lines = 38;
 
   fset_title (f, name);
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]