]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid overwriting minibuffer prompt by keystrokes echo
authorEli Zaretskii <eliz@gnu.org>
Thu, 4 Feb 2021 17:35:07 +0000 (19:35 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 4 Feb 2021 17:35:07 +0000 (19:35 +0200)
* src/lread.c (Fread_char, Fread_event, Fread_char_exclusive):
Call cancel_echoing to make sure the prompt is not obscured by
keystrokes echo.  (Bug#46243)

src/lread.c

index b33a312299f674e5abe80e37afd1d847be9d6e58..010194c34ea75242659088a55dca170ba402dfa7 100644 (file)
@@ -804,7 +804,10 @@ If `inhibit-interaction' is non-nil, this function will signal an
   barf_if_interaction_inhibited ();
 
   if (! NILP (prompt))
-    message_with_string ("%s", prompt, 0);
+    {
+      cancel_echoing ();
+      message_with_string ("%s", prompt, 0);
+    }
   val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
 
   return (NILP (val) ? Qnil
@@ -839,7 +842,10 @@ If `inhibit-interaction' is non-nil, this function will signal an
   barf_if_interaction_inhibited ();
 
   if (! NILP (prompt))
-    message_with_string ("%s", prompt, 0);
+    {
+      cancel_echoing ();
+      message_with_string ("%s", prompt, 0);
+    }
   return read_filtered_event (0, 0, 0, ! NILP (inherit_input_method), seconds);
 }
 
@@ -875,7 +881,10 @@ If `inhibit-interaction' is non-nil, this function will signal an
   barf_if_interaction_inhibited ();
 
   if (! NILP (prompt))
-    message_with_string ("%s", prompt, 0);
+    {
+      cancel_echoing ();
+      message_with_string ("%s", prompt, 0);
+    }
 
   val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);