# HG changeset patch # User Richard M. Stallman # Date 1123555882 0 # Node ID f309b64476da54cec6ab7ce7a650ab535264d806 # Parent ef236edf96ecc5ff493cdcd7f29d9d7e26668f4c (while-no-input): Return t if there is input. diff -r ef236edf96ec -r f309b64476da lisp/subr.el --- 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)