diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-21 12:42:16 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-21 12:42:16 -0400 |
| commit | cafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch) | |
| tree | 7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /lisp/subr.el | |
| parent | a08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff) | |
| parent | 4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff) | |
| download | emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz | |
Merge from trunk
Diffstat (limited to 'lisp/subr.el')
| -rw-r--r-- | lisp/subr.el | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 45cfb56bdc1..9f4e35fcbe0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2066,24 +2066,24 @@ If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore keyboard-quit events while waiting for a valid input." (unless (consp chars) (error "Called `read-char-choice' without valid char choices")) - (let ((cursor-in-echo-area t) - (executing-kbd-macro executing-kbd-macro) - char done) - (while (not done) - (unless (get-text-property 0 'face prompt) - (setq prompt (propertize prompt 'face 'minibuffer-prompt))) - (setq char (let ((inhibit-quit inhibit-keyboard-quit)) - (read-key prompt))) - (cond - ((not (numberp char))) - ((memq char chars) - (setq done t)) - ((and executing-kbd-macro (= char -1)) - ;; read-event returns -1 if we are in a kbd macro and - ;; there are no more events in the macro. Attempt to - ;; get an event interactively. - (setq executing-kbd-macro nil)))) - ;; Display the question with the answer. + (let (char done) + (let ((cursor-in-echo-area t) + (executing-kbd-macro executing-kbd-macro)) + (while (not done) + (unless (get-text-property 0 'face prompt) + (setq prompt (propertize prompt 'face 'minibuffer-prompt))) + (setq char (let ((inhibit-quit inhibit-keyboard-quit)) + (read-key prompt))) + (cond + ((not (numberp char))) + ((memq char chars) + (setq done t)) + ((and executing-kbd-macro (= char -1)) + ;; read-event returns -1 if we are in a kbd macro and + ;; there are no more events in the macro. Attempt to + ;; get an event interactively. + (setq executing-kbd-macro nil))))) + ;; Display the question with the answer. But without cursor-in-echo-area. (message "%s%s" prompt (char-to-string char)) char)) |
