Mercurial > hg > xemacs-beta
diff lisp/vm/vm-folder.el @ 118:7d55a9ba150c r20-1b11
Import from CVS: tag r20-1b11
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:24:17 +0200 |
parents | 9f59509498e1 |
children | cca96a509cfe |
line wrap: on
line diff
--- a/lisp/vm/vm-folder.el Mon Aug 13 09:23:08 2007 +0200 +++ b/lisp/vm/vm-folder.el Mon Aug 13 09:24:17 2007 +0200 @@ -2173,17 +2173,20 @@ (error nil)) (let (timer) (and (natnump vm-flush-interval) + (not (vm-timer-using 'vm-flush-itimer-function)) (setq timer (run-at-time vm-flush-interval vm-flush-interval 'vm-flush-itimer-function nil)) (timer-set-function timer 'vm-flush-itimer-function (list timer))) (and (natnump vm-mail-check-interval) + (not (vm-timer-using 'vm-check-mail-itimer-function)) (setq timer (run-at-time vm-mail-check-interval vm-mail-check-interval 'vm-check-mail-itimer-function nil)) (timer-set-function timer 'vm-check-mail-itimer-function (list timer))) (and (natnump vm-auto-get-new-mail) + (not (vm-timer-using 'vm-get-mail-itimer-function)) (setq timer (run-at-time vm-auto-get-new-mail vm-auto-get-new-mail 'vm-get-mail-itimer-function nil)) @@ -2193,6 +2196,15 @@ (setq vm-flush-interval t vm-auto-get-new-mail t)))) +(defun vm-timer-using (fun) + (let ((p timer-list) + (done nil)) + (while (and p (not done)) + (if (eq (aref (car p) 5) fun) + (setq done t) + (setq p (cdr p)))) + p )) + ;; support for vm-mail-check-interval ;; if timer argument is present, this means we're using the Emacs ;; 'timer package rather than the 'itimer package.