Gnus users, have you seen this error?
itimer "with-timeout" signaled: (no-catch (nil) timeout)
There is a bug in `with-timeout' macro, when BODY is executed
successfuly intime, timeout handler is not destroyed and executed
lately outside the catch, giving no-catch error .. this patch fixes
this ..
----------------- cut here -----------------
--- timer-funcs.el~ Fri Oct 22 19:23:09 2004
+++ timer-funcs.el Fri Nov 18 13:20:01 2005
@@ -181,16 +181,18 @@
(timeout-forms (cdr list)))
`(let ((with-timeout-tag (cons nil nil))
with-timeout-value with-timeout-timer)
- (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
- (delete-itimer with-timeout-timer)
- with-timeout-value))))
+ (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
+ (unwind-protect
+ (progn ,@body)
+ (delete-itimer with-timeout-timer)))
+ nil))
+ ,@timeout-forms
+ with-timeout-value))))
;;;###autoload
(defun y-or-n-p-with-timeout (prompt seconds default-value)
----------------- cut ends here -----------------
Thanks!
--
lg
Show replies by date