aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-05 12:31:17 +1100
committerLars Ingebrigtsen2016-02-05 12:31:34 +1100
commitb3a28d088ff060df7690ffeaa04ac97f5c072e81 (patch)
tree1e8d1f2bb50a3c7c03654f1d64360c6f0113a77b /lisp
parent605f9019b47764d5b46544e525fa46b375951b35 (diff)
downloademacs-b3a28d088ff060df7690ffeaa04ac97f5c072e81.tar.gz
emacs-b3a28d088ff060df7690ffeaa04ac97f5c072e81.zip
Make the read-multiple-choice prompt a bit prettier
* doc/lispref/commands.texi (Reading One Event): Mention read-multiple-choice-face. * lisp/subr.el (read-multiple-choice): Make the prompting a bit prettier.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/subr.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index db1baf09c43..a45d4a721b7 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2255,7 +2255,7 @@ Usage example:
2255 (let* ((altered-names nil) 2255 (let* ((altered-names nil)
2256 (full-prompt 2256 (full-prompt
2257 (format 2257 (format
2258 "%s (%s, ?): " 2258 "%s (%s): "
2259 prompt 2259 prompt
2260 (mapconcat 2260 (mapconcat
2261 (lambda (elem) 2261 (lambda (elem)
@@ -2285,19 +2285,25 @@ Usage example:
2285 (push (cons (car elem) altered-name) 2285 (push (cons (car elem) altered-name)
2286 altered-names) 2286 altered-names)
2287 altered-name)) 2287 altered-name))
2288 choices ", "))) 2288 (append choices '((?? "?")))
2289 tchar buf) 2289 ", ")))
2290 tchar buf wrong-char)
2290 (save-window-excursion 2291 (save-window-excursion
2291 (save-excursion 2292 (save-excursion
2292 (while (not tchar) 2293 (while (not tchar)
2293 (message "%s" full-prompt) 2294 (message "%s%s"
2295 (if wrong-char
2296 "Invalid choice. "
2297 "")
2298 full-prompt)
2294 (setq tchar (condition-case nil 2299 (setq tchar (condition-case nil
2295 (read-char) 2300 (read-char)
2296 (error nil))) 2301 (error nil)))
2297 ;; The user has entered an invalid choice, so display the 2302 ;; The user has entered an invalid choice, so display the
2298 ;; help messages. 2303 ;; help messages.
2299 (when (not (assq tchar choices)) 2304 (when (not (assq tchar choices))
2300 (setq tchar nil) 2305 (setq wrong-char (not (memq tchar '(?? ?\C-h)))
2306 tchar nil)
2301 (with-help-window (setq buf (get-buffer-create 2307 (with-help-window (setq buf (get-buffer-create
2302 "*Multiple Choice Help*")) 2308 "*Multiple Choice Help*"))
2303 (with-current-buffer buf 2309 (with-current-buffer buf