aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-02-01 23:06:37 -0800
committerGlenn Morris2012-02-01 23:06:37 -0800
commit7e2734bc381568d40f83d6cdfa7043bdfdde17f9 (patch)
tree927d56ea8be79093d43ad024c9ae82db2aad8d80
parentf58b98224129b2b7996d22d7232438350787f898 (diff)
downloademacs-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/ChangeLog3
-rw-r--r--doc/lispref/commands.texi11
-rw-r--r--doc/lispref/help.texi11
-rw-r--r--etc/NEWS1
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 @@
12012-02-02 Glenn Morris <rgm@gnu.org> 12012-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
2472echo area as a prompt, or @code{nil}, meaning not to display a prompt. 2472echo 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
2476This function uses @code{read-key} to read and return a single
2477character. It ignores any input that is not a member of @var{chars},
2478a list of accepted characters. Optionally, it will also ignore
2479keyboard-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
2481while calling @code{read-char-choice}, then pressing @code{help-char}
2482causes it to evaluate @code{help-form} and display the result. It
2483then 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
582whenever the character @code{help-char} is read. If evaluating the form 582whenever the character @code{help-char} is read. If evaluating the form
583produces a string, that string is displayed. 583produces a string, that string is displayed.
584 584
585A command that calls @code{read-event} or @code{read-char} probably 585A command that calls @code{read-event}, @code{read-char-choice}, or
586should bind @code{help-form} to a non-@code{nil} expression while it 586@code{read-char} probably should bind @code{help-form} to a
587does input. (The time when you should not do this is when @kbd{C-h} has 587non-@code{nil} expression while it does input. (The time when you
588some other meaning.) Evaluating this expression should result in a 588should not do this is when @kbd{C-h} has some other meaning.)
589string that explains what the input is for and how to enter it properly. 589Evaluating this expression should result in a string that explains
590what the input is for and how to enter it properly.
590 591
591Entry to the minibuffer binds this variable to the value of 592Entry 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}).
diff --git a/etc/NEWS b/etc/NEWS
index 0299572ca58..ec508771abc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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
1254higher-resolution time stamps. 1254higher-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,
1257discarding any inputs not inside the set. 1258discarding any inputs not inside the set.
1258 1259