/* 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]))
{
/* 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))