changeset 15543:1047c2816dd4

(redisplay_internal): Use last_had_star to decide whether to update the mode line to update the star. (update_menu_bar): Likewise. Also, don't set w->update_mode_line for frames that use set_frame_menubar. (redisplay_internal, mark_window_display_accurate): Set last_had_star.
author Richard M. Stallman <rms@gnu.org>
date Fri, 28 Jun 1996 08:10:29 +0000
parents f57ee448e79e
children ef2b47c6c225
files src/xdisp.c
diffstat 1 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Fri Jun 28 08:09:53 1996 +0000
+++ b/src/xdisp.c	Fri Jun 28 08:10:29 1996 +0000
@@ -881,9 +881,8 @@
   if (windows_or_buffers_changed)
     update_mode_lines++;
 
-  /* Detect case that we need to write a star in the mode line.  */
-  if (XFASTINT (w->last_modified) < MODIFF
-      && XFASTINT (w->last_modified) <= SAVE_MODIFF)
+  /* Detect case that we need to write or remove a star in the mode line.  */
+  if ((SAVE_MODIFF < MODIFF) != !NILP (w->last_had_star))
     {
       w->update_mode_line = Qt;
       if (buffer_shared > 1)
@@ -1201,6 +1200,9 @@
 	  b->clip_changed = 0;
 	  w->update_mode_line = Qnil;
 	  XSETFASTINT (w->last_modified, BUF_MODIFF (b));
+	  w->last_had_star
+	    = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+	       ? Qt : Qnil);
 	  w->window_end_valid = w->buffer;
 	  last_arrow_position = Voverlay_arrow_position;
 	  last_arrow_string = Voverlay_arrow_string;
@@ -1269,6 +1271,9 @@
 	{
 	  XSETFASTINT (w->last_modified,
 		       !flag ? 0 : BUF_MODIFF (XBUFFER (w->buffer)));
+	  w->last_had_star
+	    = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+	       ? Qt : Qnil);
 
 	  /* Record if we are showing a region, so can make sure to
 	     update it fully at next redisplay.  */
@@ -1341,9 +1346,9 @@
 	 windows_or_buffers_changed anyway.  */
       if (windows_or_buffers_changed
 	  || !NILP (w->update_mode_line)
-	  || (XFASTINT (w->last_modified) < MODIFF
-	      && (XFASTINT (w->last_modified)
-		  <= BUF_SAVE_MODIFF (XBUFFER (w->buffer))))
+	  || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+	       < BUF_MODIFF (XBUFFER (w->buffer)))
+	      != !NILP (w->last_had_star))
 	  || ((!NILP (Vtransient_mark_mode)
 	       && !NILP (XBUFFER (w->buffer)->mark_active))
 	      != !NILP (w->region_showing)))
@@ -1368,12 +1373,19 @@
 	    call0 (Qrecompute_lucid_menubar);
 	  safe_run_hooks (Qmenu_bar_update_hook);
 	  FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
-	  /* Make sure to redisplay the menu bar in case we change it.  */
-	  w->update_mode_line = Qt;
+	  /* Redisplay the menu bar in case we changed it.  */
 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
 	  if (FRAME_WINDOW_P (f))
 	    set_frame_menubar (f, 0, 0);
-#endif /* USE_X_TOOLKIT || HAVE_NTGUI */
+	  else
+	    /* On a terminal screen, the menu bar is an ordinary screen
+	     line, and this makes it get updated.  */
+	    w->update_mode_line = Qt;
+#else /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */
+	  /* In the non-toolkit version, the menu bar is an ordinary screen
+	     line, and this makes it get updated.  */
+	  w->update_mode_line = Qt;
+#endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */
 
 	  unbind_to (count, Qnil);
 	  set_buffer_internal_1 (prev);