(listify-key-sequence): Fix breakage with unibyte chars

* lisp/subr.el (listify-key-sequence): The funny
"7th bit is Meta" applies only to unibyte strings.

* test/lisp/subr-tests.el (subr-listify-key-sequence): New test.
This commit is contained in:
Stefan Monnier
2026-04-09 12:23:26 -04:00
parent 1d2c3cb5bb
commit 72ba149cfa
2 changed files with 4 additions and 1 deletions

View File

@@ -1806,7 +1806,7 @@ See also `current-global-map'.")
(defun listify-key-sequence (key)
"Convert a key sequence to a list of events."
(declare (side-effect-free t))
(if (vectorp key)
(if (or (vectorp key) (multibyte-string-p key))
(append key nil)
(mapcar (lambda (c)
(if (> c 127)

View File

@@ -433,6 +433,9 @@
(should (eq (global-key-binding "x") 'self-insert-command))
(should-not (global-key-binding [f12])))
(ert-deftest subr-listify-key-sequence ()
(should (equal (listify-key-sequence "ŕ°") '( ))))
;;;; Mode hooks.