From: yoichi Date: Sat, 24 Jul 2004 20:07:05 +0000 (+0000) Subject: * wl-util.el (wl-biff-start): Don't call `wl-biff-check-folders' X-Git-Tag: wl-2_11_31~59 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3ff74073f7193ecea977d00e109f7293747fd2ef;p=elisp%2Fwanderlust.git * wl-util.el (wl-biff-start): Don't call `wl-biff-check-folders' immediately. * wl.el (wl): Call `wl-biff-check-folders' explicitly. (wl-toggle-plugged): Ditto. * wl-vars.el (wl-biff-use-idle-timer): New variable. * wl-util.el (wl-biff-start): Use idle timer if `wl-biff-use-idle-timer' is non-nil. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index cbcaa10..9ce6758 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,14 @@ +2004-07-25 Yoichi NAKAYAMA + + * wl-util.el (wl-biff-start): Don't call `wl-biff-check-folders' + immediately. + * wl.el (wl): Call `wl-biff-check-folders' explicitly. + (wl-toggle-plugged): Ditto. + + * wl-vars.el (wl-biff-use-idle-timer): New variable. + * wl-util.el (wl-biff-start): Use idle timer if + `wl-biff-use-idle-timer' is non-nil. + 2004-07-21 Yoichi NAKAYAMA * wl-highlight.el (wl-highlight-message): Fix description. diff --git a/wl/wl-util.el b/wl/wl-util.el index 654c8f0..c486788 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -717,9 +717,9 @@ that `read' can handle, whenever this is possible." (defun wl-biff-start () (wl-biff-stop) (when wl-biff-check-folder-list - (wl-biff-check-folders) (start-itimer wl-biff-timer-name 'wl-biff-check-folders - wl-biff-check-interval wl-biff-check-interval)))) + wl-biff-check-interval wl-biff-check-interval + wl-biff-use-idle-timer)))) ((and (condition-case nil (require 'timer) (error nil));; FSFmacs 19+ (fboundp 'timer-activate)) @@ -731,14 +731,27 @@ that `read' can handle, whenever this is possible." (defun wl-biff-start () (require 'timer) (when wl-biff-check-folder-list - (wl-biff-check-folders) - (if (get 'wl-biff 'timer) - (timer-activate (get 'wl-biff 'timer)) - (put 'wl-biff 'timer (run-at-time + (if wl-biff-use-idle-timer + (if (get 'wl-biff 'timer) + (progn (timer-set-idle-time (get 'wl-biff 'timer) + wl-biff-check-interval t) + (timer-activate-when-idle (get 'wl-biff 'timer))) + (put 'wl-biff 'timer + (run-with-idle-timer + wl-biff-check-interval t 'wl-biff-event-handler))) + (if (get 'wl-biff 'timer) + (progn + (timer-set-time (get 'wl-biff 'timer) (timer-next-integral-multiple-of-time (current-time) wl-biff-check-interval) - wl-biff-check-interval - 'wl-biff-event-handler))))) + wl-biff-check-interval) + (timer-activate (get 'wl-biff 'timer))) + (put 'wl-biff 'timer + (run-at-time + (timer-next-integral-multiple-of-time + (current-time) wl-biff-check-interval) + wl-biff-check-interval + 'wl-biff-event-handler)))))) (defun-maybe timer-next-integral-multiple-of-time (time secs) "Yield the next value after TIME that is an integral multiple of SECS. diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 5f20df4..3f6d4e7 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -2072,6 +2072,11 @@ every intervals specified by wl-biff-check-interval." :type 'integer :group 'wl-highlight) +(defcustom wl-biff-use-idle-timer nil + "Non-nil to use idle timer instead of strict timer for wl-biff" + :type 'boolean + :group 'wl-highlight) + (defcustom wl-biff-state-indicator-on (if (and (featurep 'xemacs) (not (featurep 'mule))) "[Mail]" diff --git a/wl/wl.el b/wl/wl.el index 3a371e6..d05e4d0 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -112,7 +112,10 @@ (progn ;; flush queue!! (elmo-dop-queue-flush) - (unless queue-flush-only (wl-biff-start)) + (unless queue-flush-only + (when wl-biff-check-folder-list + (wl-biff-check-folders) + (wl-biff-start))) (if (and wl-draft-enable-queuing wl-auto-flush-queue) (wl-draft-queue-flush)) @@ -831,13 +834,15 @@ If ARG (prefix argument) is specified, folder checkings are skipped." (unless arg (run-hooks 'wl-auto-check-folder-pre-hook) (wl-folder-auto-check) - (run-hooks 'wl-auto-check-folder-hook)) - (unless arg (wl-biff-start))) + (run-hooks 'wl-auto-check-folder-hook))) (error (if (buffer-live-p demo-buf) (kill-buffer demo-buf)) (signal (car obj)(cdr obj))) (quit)) + (when wl-biff-check-folder-list + (unless arg (wl-biff-check-folders)) + (wl-biff-start)) (if (buffer-live-p demo-buf) (kill-buffer demo-buf))) (run-hooks 'wl-hook))