2012-02-02 Glenn Morris <rgm@gnu.org>
+ * commands.texi (Reading One Event):
+ * help.texi (Help Functions): Document read-char-choice.
+
* hooks.texi (Standard Hooks):
* modes.texi (Keymaps and Minor Modes):
* text.texi (Commands for Insertion): Document post-self-insert-hook.
echo area as a prompt, or @code{nil}, meaning not to display a prompt.
@end defun
+@defun read-char-choice prompt chars &optional inhibit-quit
+This function uses @code{read-key} to read and return a single
+character. It ignores any input that is not a member of @var{chars},
+a list of accepted characters. Optionally, it will also ignore
+keyboard-quit events while it is waiting for valid input. If you bind
+@code{help-form} (@pxref{Help Functions}) to a non-@code{nil} value
+while calling @code{read-char-choice}, then pressing @code{help-char}
+causes it to evaluate @code{help-form} and display the result. It
+then continues to wait for a valid input character, or keyboard-quit.
+@end defun
+
@node Event Mod
@subsection Modifying and Translating Input Events
whenever the character @code{help-char} is read. If evaluating the form
produces a string, that string is displayed.
-A command that calls @code{read-event} or @code{read-char} probably
-should bind @code{help-form} to a non-@code{nil} expression while it
-does input. (The time when you should not do this is when @kbd{C-h} has
-some other meaning.) Evaluating this expression should result in a
-string that explains what the input is for and how to enter it properly.
+A command that calls @code{read-event}, @code{read-char-choice}, or
+@code{read-char} probably should bind @code{help-form} to a
+non-@code{nil} expression while it does input. (The time when you
+should not do this is when @kbd{C-h} has some other meaning.)
+Evaluating this expression should result in a string that explains
+what the input is for and how to enter it properly.
Entry to the minibuffer binds this variable to the value of
@code{minibuffer-help-form} (@pxref{Definition of minibuffer-help-form}).
** The function format-time-string now supports the %N directive, for
higher-resolution time stamps.
++++
** New function `read-char-choice' reads a restricted set of characters,
discarding any inputs not inside the set.