diff options
| author | Stefan Monnier | 2011-03-14 22:42:31 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-14 22:42:31 -0400 |
| commit | 49c5410a593ad8b162e5c4608e2210f839539f7f (patch) | |
| tree | 1a347fa329806f904433469546a033557c354235 | |
| parent | 047b2bb9a27dc4f20a9e346782235efceedb7b9c (diff) | |
| download | emacs-49c5410a593ad8b162e5c4608e2210f839539f7f.tar.gz emacs-49c5410a593ad8b162e5c4608e2210f839539f7f.zip | |
* lisp/subr.el (read-char-choice): Only show the cursor after the prompt,
not after the answer.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/subr.el | 36 |
2 files changed, 23 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6d80ed0f5bd..4bcb1117b1c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * subr.el (read-char-choice): Only show the cursor after the prompt, | ||
| 4 | not after the answer. | ||
| 5 | |||
| 1 | 2011-03-15 Kevin Ryde <user42@zip.com.au> | 6 | 2011-03-15 Kevin Ryde <user42@zip.com.au> |
| 2 | 7 | ||
| 3 | * help-fns.el (variable-at-point): Skip leading quotes, if any | 8 | * help-fns.el (variable-at-point): Skip leading quotes, if any |
diff --git a/lisp/subr.el b/lisp/subr.el index 3330fa20379..6f39a41709e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2003,24 +2003,24 @@ If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore | |||
| 2003 | keyboard-quit events while waiting for a valid input." | 2003 | keyboard-quit events while waiting for a valid input." |
| 2004 | (unless (consp chars) | 2004 | (unless (consp chars) |
| 2005 | (error "Called `read-char-choice' without valid char choices")) | 2005 | (error "Called `read-char-choice' without valid char choices")) |
| 2006 | (let ((cursor-in-echo-area t) | 2006 | (let (char done) |
| 2007 | (executing-kbd-macro executing-kbd-macro) | 2007 | (let ((cursor-in-echo-area t) |
| 2008 | char done) | 2008 | (executing-kbd-macro executing-kbd-macro)) |
| 2009 | (while (not done) | 2009 | (while (not done) |
| 2010 | (unless (get-text-property 0 'face prompt) | 2010 | (unless (get-text-property 0 'face prompt) |
| 2011 | (setq prompt (propertize prompt 'face 'minibuffer-prompt))) | 2011 | (setq prompt (propertize prompt 'face 'minibuffer-prompt))) |
| 2012 | (setq char (let ((inhibit-quit inhibit-keyboard-quit)) | 2012 | (setq char (let ((inhibit-quit inhibit-keyboard-quit)) |
| 2013 | (read-key prompt))) | 2013 | (read-key prompt))) |
| 2014 | (cond | 2014 | (cond |
| 2015 | ((not (numberp char))) | 2015 | ((not (numberp char))) |
| 2016 | ((memq char chars) | 2016 | ((memq char chars) |
| 2017 | (setq done t)) | 2017 | (setq done t)) |
| 2018 | ((and executing-kbd-macro (= char -1)) | 2018 | ((and executing-kbd-macro (= char -1)) |
| 2019 | ;; read-event returns -1 if we are in a kbd macro and | 2019 | ;; read-event returns -1 if we are in a kbd macro and |
| 2020 | ;; there are no more events in the macro. Attempt to | 2020 | ;; there are no more events in the macro. Attempt to |
| 2021 | ;; get an event interactively. | 2021 | ;; get an event interactively. |
| 2022 | (setq executing-kbd-macro nil)))) | 2022 | (setq executing-kbd-macro nil))))) |
| 2023 | ;; Display the question with the answer. | 2023 | ;; Display the question with the answer. But without cursor-in-echo-area. |
| 2024 | (message "%s%s" prompt (char-to-string char)) | 2024 | (message "%s%s" prompt (char-to-string char)) |
| 2025 | char)) | 2025 | char)) |
| 2026 | 2026 | ||