diff options
| author | Glenn Morris | 2012-02-01 23:06:37 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-02-01 23:06:37 -0800 |
| commit | 7e2734bc381568d40f83d6cdfa7043bdfdde17f9 (patch) | |
| tree | 927d56ea8be79093d43ad024c9ae82db2aad8d80 | |
| parent | f58b98224129b2b7996d22d7232438350787f898 (diff) | |
| download | emacs-7e2734bc381568d40f83d6cdfa7043bdfdde17f9.tar.gz emacs-7e2734bc381568d40f83d6cdfa7043bdfdde17f9.zip | |
Document read-char-choice.
* doc/lispref/commands.texi (Reading One Event):
* doc/lispref/help.texi (Help Functions): Document read-char-choice.
* etc/NEWS: Markup.
| -rw-r--r-- | doc/lispref/ChangeLog | 3 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 11 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
4 files changed, 21 insertions, 5 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 5765b151b41..f95b53bc45f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-02-02 Glenn Morris <rgm@gnu.org> | 1 | 2012-02-02 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * commands.texi (Reading One Event): | ||
| 4 | * help.texi (Help Functions): Document read-char-choice. | ||
| 5 | |||
| 3 | * hooks.texi (Standard Hooks): | 6 | * hooks.texi (Standard Hooks): |
| 4 | * modes.texi (Keymaps and Minor Modes): | 7 | * modes.texi (Keymaps and Minor Modes): |
| 5 | * text.texi (Commands for Insertion): Document post-self-insert-hook. | 8 | * text.texi (Commands for Insertion): Document post-self-insert-hook. |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 3d2b813b592..aff7a0c5f27 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -2472,6 +2472,17 @@ The argument @var{prompt} is either a string to be displayed in the | |||
| 2472 | echo area as a prompt, or @code{nil}, meaning not to display a prompt. | 2472 | echo area as a prompt, or @code{nil}, meaning not to display a prompt. |
| 2473 | @end defun | 2473 | @end defun |
| 2474 | 2474 | ||
| 2475 | @defun read-char-choice prompt chars &optional inhibit-quit | ||
| 2476 | This function uses @code{read-key} to read and return a single | ||
| 2477 | character. It ignores any input that is not a member of @var{chars}, | ||
| 2478 | a list of accepted characters. Optionally, it will also ignore | ||
| 2479 | keyboard-quit events while it is waiting for valid input. If you bind | ||
| 2480 | @code{help-form} (@pxref{Help Functions}) to a non-@code{nil} value | ||
| 2481 | while calling @code{read-char-choice}, then pressing @code{help-char} | ||
| 2482 | causes it to evaluate @code{help-form} and display the result. It | ||
| 2483 | then continues to wait for a valid input character, or keyboard-quit. | ||
| 2484 | @end defun | ||
| 2485 | |||
| 2475 | @node Event Mod | 2486 | @node Event Mod |
| 2476 | @subsection Modifying and Translating Input Events | 2487 | @subsection Modifying and Translating Input Events |
| 2477 | 2488 | ||
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 678ea83465f..f6556639e98 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -582,11 +582,12 @@ If this variable is non-@code{nil}, its value is a form to evaluate | |||
| 582 | whenever the character @code{help-char} is read. If evaluating the form | 582 | whenever the character @code{help-char} is read. If evaluating the form |
| 583 | produces a string, that string is displayed. | 583 | produces a string, that string is displayed. |
| 584 | 584 | ||
| 585 | A command that calls @code{read-event} or @code{read-char} probably | 585 | A command that calls @code{read-event}, @code{read-char-choice}, or |
| 586 | should bind @code{help-form} to a non-@code{nil} expression while it | 586 | @code{read-char} probably should bind @code{help-form} to a |
| 587 | does input. (The time when you should not do this is when @kbd{C-h} has | 587 | non-@code{nil} expression while it does input. (The time when you |
| 588 | some other meaning.) Evaluating this expression should result in a | 588 | should not do this is when @kbd{C-h} has some other meaning.) |
| 589 | string that explains what the input is for and how to enter it properly. | 589 | Evaluating this expression should result in a string that explains |
| 590 | what the input is for and how to enter it properly. | ||
| 590 | 591 | ||
| 591 | Entry to the minibuffer binds this variable to the value of | 592 | Entry to the minibuffer binds this variable to the value of |
| 592 | @code{minibuffer-help-form} (@pxref{Definition of minibuffer-help-form}). | 593 | @code{minibuffer-help-form} (@pxref{Definition of minibuffer-help-form}). |
| @@ -1253,6 +1253,7 @@ jumping all the way to the top-level. | |||
| 1253 | ** The function format-time-string now supports the %N directive, for | 1253 | ** The function format-time-string now supports the %N directive, for |
| 1254 | higher-resolution time stamps. | 1254 | higher-resolution time stamps. |
| 1255 | 1255 | ||
| 1256 | +++ | ||
| 1256 | ** New function `read-char-choice' reads a restricted set of characters, | 1257 | ** New function `read-char-choice' reads a restricted set of characters, |
| 1257 | discarding any inputs not inside the set. | 1258 | discarding any inputs not inside the set. |
| 1258 | 1259 | ||