aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSean Whitton2025-10-21 18:03:11 +0100
committerSean Whitton2025-11-13 17:17:34 +0000
commit5e819f76dcdbb6777f5647148d3d2c7a3ec22519 (patch)
tree6570bc03b730f7fbc5f8780ffdb3d01623526a23 /src
parent8e5c4c411d0773f40cda869112e791d59b7d132f (diff)
downloademacs-5e819f76dcdbb6777f5647148d3d2c7a3ec22519.tar.gz
emacs-5e819f76dcdbb6777f5647148d3d2c7a3ec22519.zip
read_key_sequence: Additional check for fix_current_buffer
* src/keyboard.c (read_key_sequence): If we were interrupted while initializing the terminal, also check for a change of current buffer (bug#79513).
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index a9cbd107dde..c06c38f2e3f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11150,9 +11150,10 @@ read_key_sequence (Lisp_Object *keybuf, Lisp_Object prompt,
11150 if ((FIXNUMP (key) && XFIXNUM (key) == -2) /* wrong_kboard_jmpbuf */ 11150 if ((FIXNUMP (key) && XFIXNUM (key) == -2) /* wrong_kboard_jmpbuf */
11151 /* When switching to a new tty (with a new keyboard), 11151 /* When switching to a new tty (with a new keyboard),
11152 read_char returns the new buffer, rather than -2 11152 read_char returns the new buffer, rather than -2
11153 (Bug#5095). This is because `terminal-init-xterm' 11153 (bug#5095, bug#37782, bug#79513).
11154 calls read-char, which eats the wrong_kboard_jmpbuf 11154 This is because `terminal-init-xterm' calls
11155 return. Any better way to fix this? -- cyd */ 11155 read-char, which eats the wrong_kboard_jmpbuf return.
11156 Any better way to fix this? -- cyd */
11156 || (interrupted_kboard != current_kboard)) 11157 || (interrupted_kboard != current_kboard))
11157 { 11158 {
11158 bool found = false; 11159 bool found = false;
@@ -11205,8 +11206,14 @@ read_key_sequence (Lisp_Object *keybuf, Lisp_Object prompt,
11205 if (FIXNUMP (key) && XFIXNUM (key) != -2) 11206 if (FIXNUMP (key) && XFIXNUM (key) != -2)
11206 { 11207 {
11207 /* If interrupted while initializing terminal, we 11208 /* If interrupted while initializing terminal, we
11208 need to replay the interrupting key. See 11209 need to replay the interrupting key.
11209 Bug#5095 and Bug#37782. */ 11210 There may also have been a current buffer
11211 change we would otherwise miss.
11212 See bug#5095, bug#37782, bug#79513. */
11213 if (fix_current_buffer
11214 && (XBUFFER (XWINDOW (selected_window)->contents)
11215 != current_buffer))
11216 Fset_buffer (XWINDOW (selected_window)->contents);
11210 mock_input = 1; 11217 mock_input = 1;
11211 keybuf[0] = key; 11218 keybuf[0] = key;
11212 } 11219 }