Steve Youngs <steve(a)sxemacs.org> writes:
[..]
,----
| 2005-10-11 Steve Youngs <steve(a)sxemacs.org>
|
| * timer-funcs.el (with-timeout): Use `unwind-protect' to ensure
| the timer is always deleted.
| From: tbennett(a)nvidia.com
|
`----
It is in xemacs-base package version 1.99 and above. Here is the
current `with-timeout'...
,----
| (defmacro with-timeout (list &rest body)
| "Run BODY, but if it doesn't finish in SECONDS seconds, give up.
| 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...)
| The timeout is checked whenever XEmacs waits for some kind of external
| event \(such as keyboard input, input from subprocesses, or a certain time);
| if the program loops without waiting in any way, the timeout will not
| be detected."
| (let ((seconds (car list))
| (timeout-forms (cdr list)))
| `(let ((with-timeout-tag (cons nil nil))
| with-timeout-value with-timeout-timer)
| (unwind-protect
| (when (catch with-timeout-tag
| (progn
| (setq with-timeout-timer
| (start-itimer "with-timeout" #'with-timeout-handler
| ,seconds nil nil t with-timeout-tag))
| (setq with-timeout-value (progn ,@body))
| nil))
| ,@timeout-forms
| with-timeout-value)
| (delete-itimer with-timeout-timer)))))
`----
...does it not work for you?
No, it work! However i was not having this version of `with-timeout'
in sumo packages i've downloaded recently, so i decided that this
question is open .. sorry for disturbing water
This version works very well thanks!
--
lg