changeset 64792:f309b64476da

(while-no-input): Return t if there is input.
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 Aug 2005 02:51:22 +0000
parents ef236edf96ec
children 2898eac3abad
files lisp/subr.el
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Tue Aug 09 00:56:37 2005 +0000
+++ b/lisp/subr.el	Tue Aug 09 02:51:22 2005 +0000
@@ -1833,14 +1833,14 @@
 (defmacro while-no-input (&rest body)
   "Execute BODY only as long as there's no pending input.
 If input arrives, that ends the execution of BODY,
-and `while-no-input' returns nil.  If BODY finishes,
-`while-no-input' returns whatever value BODY produced."
+and `while-no-input' returns t.  Quitting makes it return nil.
+If BODY finishes, `while-no-input' returns whatever value BODY produced."
   (declare (debug t) (indent 0))
   (let ((catch-sym (make-symbol "input")))
     `(with-local-quit
        (catch ',catch-sym
 	 (let ((throw-on-input ',catch-sym))
-	   (when (sit-for 0 0 t)
+	   (or (not (sit-for 0 0 t))
 	     ,@body))))))
 
 (defmacro combine-after-change-calls (&rest body)