# HG changeset patch # User Gerd Moellmann # Date 996672332 0 # Node ID ae77d25eb5cc2c63ab9bc0c2776cc42d0239f88a # Parent 0bfc95b507859a87ad1a374dd3768ba429e9f434 (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. diff -r 0bfc95b50785 -r ae77d25eb5cc src/xdisp.c --- 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;