408 |
(defmacro with-timeout (list &rest body) |
(defmacro with-timeout (list &rest body) |
409 |
"Run BODY, but if it doesn't finish in SECONDS seconds, give up. |
"Run BODY, but if it doesn't finish in SECONDS seconds, give up. |
410 |
If we give up, we run the TIMEOUT-FORMS and return the value of the last one. |
If we give up, we run the TIMEOUT-FORMS and return the value of the last one. |
|
The call should look like: |
|
|
(with-timeout (SECONDS TIMEOUT-FORMS...) BODY...) |
|
411 |
The timeout is checked whenever Emacs waits for some kind of external |
The timeout is checked whenever Emacs waits for some kind of external |
412 |
event \(such as keyboard input, input from subprocesses, or a certain time); |
event (such as keyboard input, input from subprocesses, or a certain time); |
413 |
if the program loops without waiting in any way, the timeout will not |
if the program loops without waiting in any way, the timeout will not |
414 |
be detected." |
be detected. |
415 |
|
\n(fn (SECONDS TIMEOUT-FORMS...) BODY)" |
416 |
(let ((seconds (car list)) |
(let ((seconds (car list)) |
417 |
(timeout-forms (cdr list))) |
(timeout-forms (cdr list))) |
418 |
`(let ((with-timeout-tag (cons nil nil)) |
`(let ((with-timeout-tag (cons nil nil)) |