21.5.22 on linux
Using tramp (rsync) gives a lot of annoying '(no-catch ...' or
'(void-handler...' messages when itimer's issued on behalf of
tramp (via 'with-timeout') fire, but the 'with-timeout' (catch
...) is no longer active.
itimer "with-timeout<5>" signaled: (void-function
with-timeout-handler)
itimer "with-timeout<6>" signaled: (void-function
with-timeout-handler)
itimer "with-timeout<7>" signaled: (void-function
with-timeout-handler)
...
I think this is happening when something in BODY param of
'with-timeout' does an unexpected 'throw' apart from the
catch/throw setup by 'with-timeout' and thus jumps over the
'delete-itimer' call inside 'with-timeout'. This definitely
happens at process finish time.
This patch to 'with-timeout' macro seems to fix it:
*** timer-funcs.el 2005/09/26 17:11:15 1.1
--- timer-funcs.el 2005/09/27 03:38:11
***************
*** 181,187 ****
(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
--- 181,188 ----
(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
***************
*** 189,196 ****
(setq with-timeout-value (progn ,@body))
nil))
,@timeout-forms
! (delete-itimer with-timeout-timer)
! with-timeout-value))))
;;;###autoload
(defun y-or-n-p-with-timeout (prompt seconds default-value)
--- 190,198 ----
(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)
Note you must byte-compile everything that uses 'with-timeout' after
loading the new macro definition. Ie: tramp.el, poe-xemacs.el,
bbdb.el, feedmail.el, and perhaps others.
--
--tony