]> git.eshelyaron.com Git - emacs.git/commit
Continue reading in 'read-event' etc. at the end of a keyboard macro
authorTim Ruffing <crypto@timruffing.de>
Wed, 27 Dec 2023 13:32:09 +0000 (14:32 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 11 Mar 2024 09:26:33 +0000 (10:26 +0100)
commit33cbb47b0e03c3261fd680c7621bb109a7b5bd43
treee58dcbdc10cd1cf9ed9eafe741180995d793fd02
parenta0f8b4232e1007c70ad0b02de03bde65f8a73ad5
Continue reading in 'read-event' etc. at the end of a keyboard macro

This fixes a bug that could make 'read-event', 'read-char', and
'read-char-exclusive' erroneously return -1, an internal magic return
value of 'read_char' leaked from C to lisp. Instead of returning -1, the
aforementioned lisp functions now transparently continue reading
available input (e.g., from the keyboard) when reaching the end of a
keyboard macro.

* src/keyboard.c (read_char, read_key_sequence): Move handling
of the end of a keyboard macro from 'read_char' to its caller
'read_key_sequence', which is the only caller that can
meaningfully deal with this case.
* src/macros.c (Fexecute_kbd_macro): Document how the end of keyboard
macro is processed.
* etc/NEWS: Announce this change.

(cherry picked from commit 6f46dd516b84ad7d59b49c2e9e3fc1a2d4ef4d1c)
etc/NEWS
src/keyboard.c
src/macros.c