From 1fdb6358739828d3bcd1ca771bf600bca019f5d3 Mon Sep 17 00:00:00 2001 From: teranisi Date: Mon, 30 Oct 2000 04:24:12 +0000 Subject: [PATCH] * wl.el (wl-toggle-plugged): Call `wl-biff-stop' if unplugged, `wl-biff-start' if plugged. * wl-util.el (wl-biff-check-folder): New function. (wl-biff-check-folders): Don't set session name prefix. Use `wl-biff-check-folder' instead of `wl-folder-check-one-entity'. (wl-biff-check-folder-async): Ditto. --- wl/ChangeLog | 8 ++++++++ wl/wl-util.el | 39 +++++++++++++++++++++++++-------------- wl/wl.el | 2 ++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index b71045a..a264200 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,13 @@ 2000-10-30 Yuuichi Teranishi + * wl.el (wl-toggle-plugged): Call `wl-biff-stop' if unplugged, + `wl-biff-start' if plugged. + + * wl-util.el (wl-biff-check-folder): New function. + (wl-biff-check-folders): Don't set session name prefix. + Use `wl-biff-check-folder' instead of `wl-folder-check-one-entity'. + (wl-biff-check-folder-async): Ditto. + * wl-address.el (wl-ldap-alias-safe-string): Replace '@' to '/' in email address. diff --git a/wl/wl-util.el b/wl/wl-util.el index 831cbde..d0606d0 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -840,7 +840,6 @@ This function is imported from Emacs 20.7." (message "Checking new mails...")) (let ((new-mails 0) (flist (or wl-biff-check-folder-list (list wl-default-folder))) - (elmo-network-session-name-prefix "BIFF-") folder) (if (eq (length flist) 1) (wl-biff-check-folder-async (car flist) (interactive-p)) @@ -851,10 +850,20 @@ This function is imported from Emacs 20.7." (when (elmo-folder-plugged-p folder) (setq new-mails (+ new-mails - (nth 0 (wl-folder-check-one-entity folder)))))) + (nth 0 (wl-biff-check-folder folder)))))) (setq wl-biff-check-folders-running nil) (wl-biff-notify new-mails (interactive-p))))))) +(defun wl-biff-check-folder (folder) + (if (eq (elmo-folder-get-type folder) 'pop3) + ;; pop3 biff should share the session. + (prog2 + (elmo-commit folder) ; Close session. + (wl-folder-check-one-entity folder) + (elmo-commit folder)) + (let ((elmo-network-session-name-prefix "BIFF-")) + (wl-folder-check-one-entity folder)))) + (defun wl-biff-check-folder-async-callback (diff data) (if (nth 1 data) (with-current-buffer (nth 1 data) @@ -868,18 +877,20 @@ This function is imported from Emacs 20.7." (defun wl-biff-check-folder-async (folder notify-minibuf) (when (elmo-folder-plugged-p folder) - (if (and (eq (elmo-folder-get-type folder) 'imap4) - (wl-folder-use-server-diff-p folder)) - ;; Check asynchronously only when IMAP4 and use server diff. - (progn - (setq elmo-folder-diff-async-callback - 'wl-biff-check-folder-async-callback) - (setq elmo-folder-diff-async-callback-data - (list folder (get-buffer wl-folder-buffer-name) - notify-minibuf)) - (elmo-folder-diff-async folder)) - (wl-biff-notify (car (wl-folder-check-one-entity folder)) - notify-minibuf) + (let ((type (elmo-folder-get-type folder))) + (if (and (eq type 'imap4) + (wl-folder-use-server-diff-p folder)) + ;; Check asynchronously only when IMAP4 and use server diff. + (progn + (setq elmo-folder-diff-async-callback + 'wl-biff-check-folder-async-callback) + (setq elmo-folder-diff-async-callback-data + (list folder (get-buffer wl-folder-buffer-name) + notify-minibuf)) + (let ((elmo-network-session-name-prefix "BIFF-")) + (elmo-folder-diff-async folder))) + (wl-biff-notify (car (wl-biff-check-folder folder)) + notify-minibuf)) (setq wl-biff-check-folders-running nil)))) ;;; wl-util.el ends here diff --git a/wl/wl.el b/wl/wl.el index 588f5b6..3f58f0c 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -111,6 +111,7 @@ (progn ;; flush queue!! (elmo-dop-queue-flush) + (wl-biff-start) (if (and wl-draft-enable-queuing wl-auto-flush-queue) (wl-draft-queue-flush)) @@ -123,6 +124,7 @@ (wl-summary-flush-pending-append-operations seen-list)) (elmo-msgdb-seen-save msgdb-dir seen-list))) (run-hooks 'wl-plugged-hook)) + (wl-biff-stop) (run-hooks 'wl-unplugged-hook)) (force-mode-line-update t)) -- 1.7.10.4