[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 701ec0bda2 2/2: Don't output spurious prefixes in read-char-exclu
From: |
Lars Ingebrigtsen |
Subject: |
master 701ec0bda2 2/2: Don't output spurious prefixes in read-char-exclusive |
Date: |
Mon, 24 Jan 2022 12:19:53 -0500 (EST) |
branch: master
commit 701ec0bda2b15fc97af6ca68fb842fb1ec9aac35
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Don't output spurious prefixes in read-char-exclusive
* src/keyboard.c (read_char): Don't touch the echo area if
Vecho_keystrokes is nil.
* src/lread.c (read_filtered_event): Bind echo_keystrokes to nil
to avoid outputting prefixes we're not going to act on anyway
(bug#19718).
---
src/keyboard.c | 13 +++++++------
src/lread.c | 9 +++++++--
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/keyboard.c b/src/keyboard.c
index 441c23e10c..9242e8dc62 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3059,12 +3059,13 @@ read_char (int commandflag, Lisp_Object map,
/* Now wipe the echo area, except for help events which do their
own stuff with the echo area. */
- if (!CONSP (c)
- || (!(EQ (Qhelp_echo, XCAR (c)))
- && !(EQ (Qswitch_frame, XCAR (c)))
- /* Don't wipe echo area for select window events: These might
- get delayed via `mouse-autoselect-window' (Bug#11304). */
- && !(EQ (Qselect_window, XCAR (c)))))
+ if (!NILP (Vecho_keystrokes)
+ && (!CONSP (c)
+ || (!(EQ (Qhelp_echo, XCAR (c)))
+ && !(EQ (Qswitch_frame, XCAR (c)))
+ /* Don't wipe echo area for select window events: These might
+ get delayed via `mouse-autoselect-window' (Bug#11304). */
+ && !(EQ (Qselect_window, XCAR (c))))))
{
if (!NILP (echo_area_buffer[0]))
{
diff --git a/src/lread.c b/src/lread.c
index 9910db27de..ec54d2d81a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -705,8 +705,13 @@ read_filtered_event (bool no_switch_frame, bool
ascii_required,
/* Read until we get an acceptable event. */
retry:
do
- val = read_char (0, Qnil, (input_method ? Qnil : Qt), 0,
- NUMBERP (seconds) ? &end_time : NULL);
+ {
+ ptrdiff_t count = SPECPDL_INDEX ();
+ specbind (Qecho_keystrokes, Qnil);
+ val = read_char (0, Qnil, (input_method ? Qnil : Qt), 0,
+ NUMBERP (seconds) ? &end_time : NULL);
+ unbind_to (count, Qnil);
+ }
while (FIXNUMP (val) && XFIXNUM (val) == -2); /* wrong_kboard_jmpbuf */
if (BUFFERP (val))