]> code.delx.au - gnu-emacs/commitdiff
(read_char): Restore echo_message_buffer after redisplay.
authorRichard M. Stallman <rms@gnu.org>
Fri, 25 Jan 2008 22:57:41 +0000 (22:57 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 25 Jan 2008 22:57:41 +0000 (22:57 +0000)
src/keyboard.c

index 4d31c9e01b8199ffcfca9bd7d58dc4f94ccd8ebd..2187c22bdb7b37edba49a5e81029d7db8f7cc9b4 100644 (file)
@@ -2704,6 +2704,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
   /* if redisplay was requested */
   if (commandflag >= 0)
     {
+      int echo_current = echo_message_buffer == echo_area_buffer[0];
+
        /* If there is pending input, process any events which are not
           user-visible, such as X selection_request events.  */
       if (input_pending
@@ -2727,6 +2729,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
          swallow_events (0);
          /* If that cleared input_pending, try again to redisplay.  */
        }
+
+      /* Prevent the redisplay we just did
+        from messing up echoing of the input after the prompt.  */
+      if (commandflag == 0 && echo_current)
+       echo_message_buffer = echo_area_buffer[0];
+
     }
 
   /* Message turns off echoing unless more keystrokes turn it on again.