mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
(while-no-input): Return t if there is input.
This commit is contained in:
parent
e3854e6549
commit
83047ee3fe
1 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue