Commit c4d4dcf1 authored by Noam Postavsky's avatar Noam Postavsky

Avoid infloop in read-multiple-choice (Bug#32257)

* lisp/emacs-lisp/rmc.el (read-multiple-choice): When `read-char'
signals an error "Non-character input-event", call `read-event' to
take the non-character event out of the queue.  Don't merge to master,
we just use `read-event' directly there, rather than this solution
which relies a particular error message.
parent 2168165e
Pipeline #1806 passed with stage
in 26 minutes and 3 seconds
......@@ -116,10 +116,15 @@ Usage example:
(cons (capitalize (cadr elem))
(car elem)))
(condition-case nil
(condition-case err
(let ((cursor-in-echo-area t))
(error nil))))
(error (when (equal (cadr err) "Non-character input-event")
;; Use up the non-character input-event.
;; Otherwise we'll just keep reading it
;; again and again (Bug#32257).
(setq answer (lookup-key query-replace-map (vector tchar) t))
(setq tchar
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment