diff options
| author | Lars Ingebrigtsen | 2016-02-04 19:51:54 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-04 19:52:07 +1100 |
| commit | 4531b03ec98b50fc61baad2b75f6faf439894583 (patch) | |
| tree | 480bd9f181799d8cf9dba26860360b57131820b9 /doc/lispref | |
| parent | d95c7bb472cd259661dfed41ccfe534f9026c826 (diff) | |
| download | emacs-4531b03ec98b50fc61baad2b75f6faf439894583.tar.gz emacs-4531b03ec98b50fc61baad2b75f6faf439894583.zip | |
New function read-multiple-choice
* doc/lispref/commands.texi (Reading One Event): Document
read-multiple-choice.
* lisp/faces.el (read-multiple-choice-face): New face.
* lisp/subr.el (read-multiple-choice): New function.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/commands.texi | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 9c1df895161..1964ec8e3fe 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -2617,6 +2617,27 @@ causes it to evaluate @code{help-form} and display the result. It | |||
| 2617 | then continues to wait for a valid input character, or keyboard-quit. | 2617 | then continues to wait for a valid input character, or keyboard-quit. |
| 2618 | @end defun | 2618 | @end defun |
| 2619 | 2619 | ||
| 2620 | @defun read-multiple-choice prompt choices | ||
| 2621 | Ask user a multiple choice question. @var{prompt} should be a string | ||
| 2622 | that will be displayed as the prompt. | ||
| 2623 | |||
| 2624 | @var{choices} is an alist where the first element in each entry is a | ||
| 2625 | character to be entered, the second element is a short name for the | ||
| 2626 | entry to be displayed while prompting (if there's room, it might be | ||
| 2627 | shortened), and the third, optional entry is a longer explanation that | ||
| 2628 | will be displayed in a help buffer if the user requests more help. | ||
| 2629 | |||
| 2630 | The return value is the matching value from @var{choices}. | ||
| 2631 | |||
| 2632 | @lisp | ||
| 2633 | (read-multiple-choice | ||
| 2634 | "Continue connecting?" | ||
| 2635 | '((?a "always" "Accept this certificate this session and for all future sessions.") | ||
| 2636 | (?s "session only" "Accept this certificate this session only.") | ||
| 2637 | (?n "no" "Refuse to use this certificate, and close the connection."))) | ||
| 2638 | @end lisp | ||
| 2639 | @end defun | ||
| 2640 | |||
| 2620 | @node Event Mod | 2641 | @node Event Mod |
| 2621 | @subsection Modifying and Translating Input Events | 2642 | @subsection Modifying and Translating Input Events |
| 2622 | @cindex modifiers of events | 2643 | @cindex modifiers of events |