From 56d1f42f3007c9b4be8ddb6322e8e2ed21d5da95 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Tue, 12 Oct 2021 12:50:21 +0000 Subject: [PATCH] Improve handling of non-character events in input methods * lisp/international/quail.el (quail-add-unread-command-events): Handle non-vector event arguments. Fixes bug#51118. --- lisp/international/quail.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 50ff307b73a..ee935b11ec0 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1382,6 +1382,8 @@ a cons cell of the form (no-record . KEY). If KEY is a vector of events, the events in the vector are prepended to `unread-command-events', after converting each event to a cons cell of the form (no-record . EVENT). +If KEY is an event, it is prepended to `unread-command-events' as a cons +cell of the form (no-record . EVENT). If RESET is non-nil, the events in `unread-command-events' are first discarded, i.e. in this case KEY will end up being the only key in `unread-command-events'." @@ -1390,7 +1392,7 @@ in `unread-command-events'." (if (characterp key) (cons (cons 'no-record key) unread-command-events) (append (mapcan (lambda (e) (list (cons 'no-record e))) - (append key nil)) + (append (if (vectorp key) key (vector key)) nil)) unread-command-events)))) (defun quail-start-translation (key) -- 2.39.2