/[emacs]/emacs/lisp/emacs-lisp/timer.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/timer.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by kfstorm, Wed Feb 9 15:50:40 2005 UTC revision 1.6 by lektu, Mon Jul 4 01:22:30 2005 UTC
# Line 408  This function returns a timer object whi Line 408  This function returns a timer object whi
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))

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26