diff options
| author | Noam Postavsky | 2019-05-21 20:33:09 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-05-26 08:46:30 -0400 |
| commit | c4d4dcf17e407a3c68e150f22b9756ef6c943070 (patch) | |
| tree | 783560c9e3462a4cb3b7259cc31a21729d9a408a | |
| parent | 2168165ec05aa663d41998adb518e778899a8edd (diff) | |
| download | emacs-c4d4dcf17e407a3c68e150f22b9756ef6c943070.tar.gz emacs-c4d4dcf17e407a3c68e150f22b9756ef6c943070.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/rmc.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 6d1adae9749..5411f2ba77b 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el | |||
| @@ -116,10 +116,15 @@ Usage example: | |||
| 116 | (cons (capitalize (cadr elem)) | 116 | (cons (capitalize (cadr elem)) |
| 117 | (car elem))) | 117 | (car elem))) |
| 118 | choices))) | 118 | choices))) |
| 119 | (condition-case nil | 119 | (condition-case err |
| 120 | (let ((cursor-in-echo-area t)) | 120 | (let ((cursor-in-echo-area t)) |
| 121 | (read-char)) | 121 | (read-char)) |
| 122 | (error nil)))) | 122 | (error (when (equal (cadr err) "Non-character input-event") |
| 123 | ;; Use up the non-character input-event. | ||
| 124 | ;; Otherwise we'll just keep reading it | ||
| 125 | ;; again and again (Bug#32257). | ||
| 126 | (read-event)) | ||
| 127 | nil)))) | ||
| 123 | (setq answer (lookup-key query-replace-map (vector tchar) t)) | 128 | (setq answer (lookup-key query-replace-map (vector tchar) t)) |
| 124 | (setq tchar | 129 | (setq tchar |
| 125 | (cond | 130 | (cond |