From caad79ddc94f4646eb68d7a7bbbbad83cfc46edc Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Sat, 23 Jan 2021 19:31:02 -0800 Subject: [PATCH 4/4] Echo area stays visible when moving xterm mouse The function read_char normally clears the active echo area after reading any event. When xterm-mouse-mode is active the event can get discarded when input-decode-map is applied (example: a mouse movement escape sequence with 'track-mouse' set to nil) in which case the echo area should stay unchanged. Other translation keymaps are not intended to ever discard events so the restoring is only done for input-decode-map. * src/keyboard.c (read_key_sequence): Restore the last displayed echo area whenever a transformation is applied by input-decode-map. --- src/keyboard.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index 9ee4c4f6d6..f6bdadbed6 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -9955,6 +9955,14 @@ read_key_sequence (Lisp_Object *keybuf, Lisp_Object prompt, if (done) { mock_input = diff + max (t, mock_input); + + /* By this point the echo area was cleared by calls to + read_char. However, we may have completely thrown + out the input (for example if decoding a mouse move + event but `track-mouse' is nil) in which case the + echo area should be restored to its pristene + state. */ + echo_area_buffer[0] = echo_area_buffer[1]; goto replay_sequence; } } -- 2.20.1