diff options
| author | Richard M. Stallman | 2005-08-09 12:00:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-08-09 12:00:09 +0000 |
| commit | 7d9f1aede8c8ac595bc6351a6e1257321e73c8e7 (patch) | |
| tree | caf3bbbb790cfd80ad1038f45dfada960fdf0528 | |
| parent | 0e15f9b48da2d0b6c2a1ddde8d616ce537b19aa0 (diff) | |
| download | emacs-7d9f1aede8c8ac595bc6351a6e1257321e73c8e7.tar.gz emacs-7d9f1aede8c8ac595bc6351a6e1257321e73c8e7.zip | |
(Event Input Misc): Update while-no-input.
| -rw-r--r-- | lispref/commands.texi | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lispref/commands.texi b/lispref/commands.texi index 5ded722155c..47025fb0c28 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi | |||
| @@ -2435,15 +2435,26 @@ Emacs version 18. | |||
| 2435 | @end defvar | 2435 | @end defvar |
| 2436 | 2436 | ||
| 2437 | @defmac while-no-input body... | 2437 | @defmac while-no-input body... |
| 2438 | This construct runs the @var{body} forms and returns the value | 2438 | This construct runs the @var{body} forms and returns the value of the |
| 2439 | of the last one---but only if no input arrives. If any input | 2439 | last one---but only if no input arrives. If any input arrives during |
| 2440 | arrives during the execution of the @var{body} forms, it aborts | 2440 | the execution of the @var{body} forms, it aborts them (working much |
| 2441 | them (working much like a quit), and the @code{while-no-input} | 2441 | like a quit). The @code{while-no-input} form returns @code{nil} if |
| 2442 | form returns @code{nil}. | 2442 | aborted by a real quit, and returns @code{t} if aborted by arrival of |
| 2443 | other input. | ||
| 2443 | 2444 | ||
| 2444 | If a part of @var{body} binds @code{inhibit-quit} to non-@code{nil}, | 2445 | If a part of @var{body} binds @code{inhibit-quit} to non-@code{nil}, |
| 2445 | arrival of input during those parts won't cause an abort until | 2446 | arrival of input during those parts won't cause an abort until |
| 2446 | the end of that part. | 2447 | the end of that part. |
| 2448 | |||
| 2449 | If you want to be able to distingish all possible values computed | ||
| 2450 | by @var{body} from both kinds of abort conditions, write the code | ||
| 2451 | like this: | ||
| 2452 | |||
| 2453 | @example | ||
| 2454 | (while-no-input | ||
| 2455 | (list | ||
| 2456 | (progn . @var{body}))) | ||
| 2457 | @end example | ||
| 2447 | @end defmac | 2458 | @end defmac |
| 2448 | 2459 | ||
| 2449 | @defun discard-input | 2460 | @defun discard-input |