changeset 38633:ae77d25eb5cc

(message_cleared_p): New variable. (clear_message): Set message_cleared_p when clearing the current message. (redisplay_internal): Look at message_cleared_p to capture the case that the echo area should be cleared.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 01 Aug 2001 13:25:32 +0000
parents 0bfc95b50785
children 488827a6778b
files src/xdisp.c
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Wed Aug 01 11:59:42 2001 +0000
+++ b/src/xdisp.c	Wed Aug 01 13:25:32 2001 +0000
@@ -510,6 +510,11 @@
 int message_truncate_lines;
 Lisp_Object Qmessage_truncate_lines;
 
+/* Set to 1 in clear_message to make redisplay_internal aware
+   of an emptied echo area.   */
+
+static int message_cleared_p;
+
 /* Non-zero means we want a hollow cursor in windows that are not
    selected.  Zero means there's no cursor in such windows.  */
 
@@ -6895,7 +6900,10 @@
      int current_p, last_displayed_p;
 {
   if (current_p)
-    echo_area_buffer[0] = Qnil;
+    {
+      echo_area_buffer[0] = Qnil;
+      message_cleared_p = 1;
+    }
   
   if (last_displayed_p)
     echo_area_buffer[1] = Qnil;
@@ -8406,12 +8414,19 @@
   /* Normally the message* functions will have already displayed and
      updated the echo area, but the frame may have been trashed, or
      the update may have been preempted, so display the echo area
-     again here.  Checking both message buffers captures the case that
+     again here.  Checking message_cleared_p captures the case that
      the echo area should be cleared.  */
-  if (!NILP (echo_area_buffer[0]) || !NILP (echo_area_buffer[1]))
+  if (!NILP (echo_area_buffer[0]) || message_cleared_p)
     {
       int window_height_changed_p = echo_area_display (0);
       must_finish = 1;
+
+      /* If we don't display the current message, don't clear the
+	 message_cleared_p flag, because, if we did, we wouldn't clear
+	 the echo area in the next redisplay which doesn't preserve
+	 the echo area.  */
+      if (!display_last_displayed_message_p)
+	message_cleared_p = 0;
       
       if (fonts_changed_p)
 	goto retry;