Commit c2b53d7b authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(while-no-input): New macro.

parent 42ed718e
......@@ -1862,6 +1862,19 @@ is allowed once again."
(quit (setq quit-flag t) nil)))
(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."
(declare (debug t) (indent 0))
(let ((catch-sym (make-symbol "input")))
(catch ',catch-sym
(let ((throw-on-input ',catch-sym))
(when (sit-for 0 0 t)
(defmacro combine-after-change-calls (&rest body)
"Execute BODY, but don't call the after-change functions till the end.
If BODY makes changes in the buffer, they are recorded
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment