]> code.delx.au - gnu-emacs/blobdiff - lispref/commands.texi
(The Buffer List): Fix xrefs.
[gnu-emacs] / lispref / commands.texi
index 29a86f98632d47188bb8b44f0b0dbb5ee3a1bcdd..47025fb0c2869c48c8872fd547135292dcdd5cbe 100644 (file)
@@ -365,8 +365,9 @@ until a command (or undefined command) is found in the current key
 maps.  The key sequence argument is represented as a string or vector.
 The cursor does not move into the echo area.  Prompt.
 
-If the key sequence is a down-event, the following up-event is discarded,
-but can be read via the @code{U} code character.
+If @samp{k} reads a key sequence that ends with a down-event, it also
+reads and discards the following up-event.  You can get access to that
+up-event with the @samp{U} code character.
 
 This kind of input is used by commands such as @code{describe-key} and
 @code{global-set-key}.
@@ -425,9 +426,10 @@ the string.)  Other characters that normally terminate a symbol (e.g.,
 parentheses and brackets) do not do so here.  Prompt.
 
 @item U
-A key sequence or @code{nil}.  May be used after a @code{k} or @code{K}
-argument to get the up-event that was discarded in case the key
-sequence read for that argument was a down-event.  No I/O.
+A key sequence or @code{nil}.  Can be used after a @samp{k} or
+@samp{K} argument to get the up-event that was discarded (if any)
+after @samp{k} or @samp{K} read a down-event.  If no up-event has been
+discarded, @samp{U} provides @code{nil} as the argument.  No I/O.
 
 @item v
 A variable declared to be a user option (i.e., satisfying the
@@ -442,8 +444,9 @@ Minibuffer}.  Prompt.
 
 @item X
 @cindex evaluated expression argument
-A Lisp form is read as with @kbd{x}, but then evaluated so that its
-value becomes the argument for the command.  Prompt.
+A Lisp form's value.  @samp{X} reads as @samp{x} does, then evaluates
+the form so that its value becomes the argument for the command.
+Prompt.
 
 @item z
 A coding system name (a symbol).  If the user enters null input, the
@@ -1770,7 +1773,7 @@ Return the window that @var{position} is in.
 @defun posn-area position
 Return the window area recorded in @var{position}.  It returns @code{nil}
 when the event occurred in the text area of the window; otherwise, it
-is a symbol identifying the area in which the the event occurred.
+is a symbol identifying the area in which the event occurred.
 @end defun
 
 @defun posn-point position
@@ -2432,15 +2435,26 @@ Emacs version 18.
 @end defvar
 
 @defmac while-no-input body...
-This construct runs the @var{body} forms and returns the value
-of the last one---but only if no input arrives.  If any input
-arrives during the execution of the @var{body} forms, it aborts
-them (working much like a quit), and the @code{while-no-input}
-form returns @code{nil}.
+This construct runs the @var{body} forms and returns the value of the
+last one---but only if no input arrives.  If any input arrives during
+the execution of the @var{body} forms, it aborts them (working much
+like a quit).  The @code{while-no-input} form returns @code{nil} if
+aborted by a real quit, and returns @code{t} if aborted by arrival of
+other input.
 
 If a part of @var{body} binds @code{inhibit-quit} to non-@code{nil},
 arrival of input during those parts won't cause an abort until
 the end of that part.
+
+If you want to be able to distingish all possible values computed
+by @var{body} from both kinds of abort conditions, write the code
+like this:
+
+@example
+(while-no-input
+  (list
+    (progn . @var{body})))
+@end example
 @end defmac
 
 @defun discard-input