From ecd98acd2c46a6b22a3f5e28a50f3bf8cd294813 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 50ff307b73..ee935b11ec 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1382,6 +1382,8 @@ quail-add-unread-command-events 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 @@ quail-add-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.33.0