mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 03:10:58 -08:00
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.
This commit is contained in:
parent
2168165ec0
commit
c4d4dcf17e
1 changed files with 7 additions and 2 deletions
|
|
@ -116,10 +116,15 @@ Usage example:
|
||||||
(cons (capitalize (cadr elem))
|
(cons (capitalize (cadr elem))
|
||||||
(car elem)))
|
(car elem)))
|
||||||
choices)))
|
choices)))
|
||||||
(condition-case nil
|
(condition-case err
|
||||||
(let ((cursor-in-echo-area t))
|
(let ((cursor-in-echo-area t))
|
||||||
(read-char))
|
(read-char))
|
||||||
(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).
|
||||||
|
(read-event))
|
||||||
|
nil))))
|
||||||
(setq answer (lookup-key query-replace-map (vector tchar) t))
|
(setq answer (lookup-key query-replace-map (vector tchar) t))
|
||||||
(setq tchar
|
(setq tchar
|
||||||
(cond
|
(cond
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue