Commit 49c5410a authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/subr.el (read-char-choice): Only show the cursor after the prompt,

not after the answer.
parent 047b2bb9
2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (read-char-choice): Only show the cursor after the prompt,
not after the answer.
2011-03-15 Kevin Ryde <user42@zip.com.au> 2011-03-15 Kevin Ryde <user42@zip.com.au>
   
* help-fns.el (variable-at-point): Skip leading quotes, if any * help-fns.el (variable-at-point): Skip leading quotes, if any
......
...@@ -2003,24 +2003,24 @@ If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore ...@@ -2003,24 +2003,24 @@ If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
keyboard-quit events while waiting for a valid input." keyboard-quit events while waiting for a valid input."
(unless (consp chars) (unless (consp chars)
(error "Called `read-char-choice' without valid char choices")) (error "Called `read-char-choice' without valid char choices"))
(let ((cursor-in-echo-area t) (let (char done)
(executing-kbd-macro executing-kbd-macro) (let ((cursor-in-echo-area t)
char done) (executing-kbd-macro executing-kbd-macro))
(while (not done) (while (not done)
(unless (get-text-property 0 'face prompt) (unless (get-text-property 0 'face prompt)
(setq prompt (propertize prompt 'face 'minibuffer-prompt))) (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
(setq char (let ((inhibit-quit inhibit-keyboard-quit)) (setq char (let ((inhibit-quit inhibit-keyboard-quit))
(read-key prompt))) (read-key prompt)))
(cond (cond
((not (numberp char))) ((not (numberp char)))
((memq char chars) ((memq char chars)
(setq done t)) (setq done t))
((and executing-kbd-macro (= char -1)) ((and executing-kbd-macro (= char -1))
;; read-event returns -1 if we are in a kbd macro and ;; read-event returns -1 if we are in a kbd macro and
;; there are no more events in the macro. Attempt to ;; there are no more events in the macro. Attempt to
;; get an event interactively. ;; get an event interactively.
(setq executing-kbd-macro nil)))) (setq executing-kbd-macro nil)))))
;; Display the question with the answer. ;; Display the question with the answer. But without cursor-in-echo-area.
(message "%s%s" prompt (char-to-string char)) (message "%s%s" prompt (char-to-string char))
char)) char))
......
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