From: Richard M. Stallman Date: Tue, 9 Aug 2005 02:51:22 +0000 (+0000) Subject: (while-no-input): Return t if there is input. X-Git-Tag: emacs-pretest-22.0.90~7743 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83047ee3fe97982bba066d6123a21b41e35edde0;p=emacs.git (while-no-input): Return t if there is input. --- diff --git a/lisp/subr.el b/lisp/subr.el index 4704dd1e99e..f97a2e40f71 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1833,14 +1833,14 @@ is allowed once again." (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)