diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 27e5d6c612b..c4df8cf2f98 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -216,8 +216,14 @@ Usage example: (car elem))) prompt-choices))) (condition-case nil - (let ((cursor-in-echo-area t)) - (read-event)) + (let ((cursor-in-echo-area t) + ;; Do NOT use read-event here. That + ;; function does not consult + ;; input-decode-map (bug#75886). + (key (read-key))) + (when (eq key ?\C-g) + (signal 'quit nil)) + key) (error nil)))) (if (memq (car-safe tchar) '(touchscreen-begin touchscreen-end diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el index 1bc8c90cad6..0237bc3f9e5 100644 --- a/test/lisp/emacs-lisp/rmc-tests.el +++ b/test/lisp/emacs-lisp/rmc-tests.el @@ -61,7 +61,7 @@ (ert-deftest test-read-multiple-choice () (dolist (char '(?y ?n)) - (cl-letf* (((symbol-function #'read-event) (lambda () char)) + (cl-letf* (((symbol-function #'read-key) (lambda () char)) (str (if (eq char ?y) "yes" "no"))) (should (equal (list char str) (read-multiple-choice "Do it? " '((?y "yes") (?n "no")))))))) @@ -69,7 +69,7 @@ (ert-deftest test-read-multiple-choice-help () (let ((chars '(?o ?a)) help) - (cl-letf* (((symbol-function #'read-event) + (cl-letf* (((symbol-function #'read-key) (lambda () (message "chars %S" chars) (when (= 1 (length chars))