User: youngs
Date: 05/10/11 13:21:42
Modified: packages/xemacs-packages/xemacs-base ChangeLog
timer-funcs.el
Log:
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
Revision Changes Path
1.170 +6 -0 XEmacs/packages/xemacs-packages/xemacs-base/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/ChangeLog,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -p -r1.169 -r1.170
--- ChangeLog 2005/07/24 09:03:06 1.169
+++ ChangeLog 2005/10/11 11:21:41 1.170
@@ -1,3 +1,9 @@
+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
+
2005-07-24 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.98 released.
1.2 +12 -10 XEmacs/packages/xemacs-packages/xemacs-base/timer-funcs.el
Index: timer-funcs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/timer-funcs.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- timer-funcs.el 2004/10/22 15:23:09 1.1
+++ timer-funcs.el 2005/10/11 11:21:41 1.2
@@ -181,16 +181,18 @@ be detected."
(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))))
+ (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)))))
+
;;;###autoload
(defun y-or-n-p-with-timeout (prompt seconds default-value)