* wl-draft.el (wl-draft-do-fcc): No cache save.
[elisp/wanderlust.git] / wl / wl.el
index c4ca68d..209e08f 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -56,6 +56,7 @@
 (provide 'wl)                          ; circular dependency
 (require 'wl-folder)
 (require 'wl-summary)
+(require 'wl-action)
 (require 'wl-thread)
 (require 'wl-address)
 (require 'wl-news)
@@ -72,7 +73,8 @@
   (require 'smtp)
   (require 'wl-score)
   (require 'wl-fldmgr)
-  (require 'wl-mime))
+  (require 'wl-mime)
+  (require 'wl-spam))
 
 (defun wl-plugged-init (&optional make-alist)
   (setq elmo-plugged wl-plugged)
       (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))
@@ -630,23 +635,33 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
   (wl-save-status 'keep-summary)
   (run-hooks 'wl-save-hook))
 
+(defun wl-execute-temp-marks ()
+  "Execute temporary marks in summary buffers."
+  (interactive)
+  (let ((summaries (wl-collect-summary)))
+    (while summaries
+      (with-current-buffer (car summaries)
+       (wl-summary-exec-with-confirmation)
+       (wl-summary-save-status))
+      (setq summaries (cdr summaries)))))
+
 (defun wl-save-status (&optional keep-summary)
   (message "Saving summary and folder status...")
-  (let (summary-buf)
-    (save-excursion
-      (let ((summaries (wl-collect-summary)))
-       (while summaries
-         (with-current-buffer (car summaries)
-           (unless keep-summary
-             (wl-summary-cleanup-temp-marks))
-           (wl-summary-save-view)
-           (elmo-folder-commit wl-summary-buffer-elmo-folder)
-           (unless keep-summary
-             (kill-buffer (car summaries))))
-         (setq summaries (cdr summaries))))))
+  (save-excursion
+    (let ((summaries (wl-collect-summary)))
+      (while summaries
+       (with-current-buffer (car summaries)
+         (unless keep-summary
+           (wl-summary-cleanup-temp-marks))
+         (wl-summary-save-view)
+         (elmo-folder-commit wl-summary-buffer-elmo-folder)
+         (unless keep-summary
+           (kill-buffer (car summaries))))
+       (setq summaries (cdr summaries)))))
   (wl-refile-alist-save)
   (wl-folder-info-save)
   (and (featurep 'wl-fldmgr) (wl-fldmgr-exit))
+  (and (featurep 'wl-spam) (wl-spam-save-status))
   (elmo-crosspost-message-alist-save)
   (message "Saving summary and folder status...done"))
 
@@ -657,6 +672,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
     (elmo-quit)
     (when wl-use-acap (funcall (symbol-function 'wl-acap-exit)))
     (wl-biff-stop)
+    (elmo-passwd-alist-clear)
     (run-hooks 'wl-exit-hook)
     (wl-save-status)
     (wl-folder-cleanup-variables)
@@ -695,6 +711,12 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
          (symbol-value 'wl-summary-subject-function))
     (fset 'wl-summary-subject-filter-func-internal
          (symbol-value 'wl-summary-subject-filter-function))
+    (wl-summary-define-mark-action)
+    (dolist (spec wl-summary-flag-alist)
+      (set-face-foreground
+       (make-face (intern
+                  (format "wl-highlight-summary-%s-flag-face" (car spec))))
+       (nth 1 spec)))
     (setq elmo-no-from wl-summary-no-from-message)
     (setq elmo-no-subject wl-summary-no-subject-message)
     (wl-news-check)
@@ -728,8 +750,6 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
          (queue-folder (wl-folder-get-elmo-folder wl-queue-folder))
          (lost+found-folder (wl-folder-get-elmo-folder
                              elmo-lost+found-folder)))
-      (if (not (elmo-folder-message-file-p draft-folder))
-         (error "%s is not allowed for draft folder" wl-draft-folder))
       (unless (elmo-folder-exists-p draft-folder)
        (if (y-or-n-p
             (format "Draft Folder %s does not exist, create it? "
@@ -784,17 +804,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
                wl-message-buffer-cache-size))
        (error (concat
                "`wl-message-buffer-prefetch-depth' must be smaller than "
-               "`wl-message-buffer-cache-size' - 1."))))
-  (let (case-fold-search)
-    (unless (string-match "%T" wl-summary-line-format)
-      (error "`wl-summary-line-format' must contain %%T and %%P"))
-    (unless (string-match "%P" wl-summary-line-format)
-      (error "`wl-summary-line-format' must contain %%T and %%P"))
-    (dolist (pair wl-folder-summary-line-format-alist)
-      (unless (string-match "%T" (cdr pair))
-       (error "Format `%s' must contain %%T and %%P" (cdr pair)))
-      (unless (string-match "%P" (cdr pair))
-       (error "Format `%s' must contain %%T and %%P" (cdr pair))))))
+               "`wl-message-buffer-cache-size' - 1.")))))
 
 ;;;###autoload
 (defun wl (&optional arg)
@@ -803,7 +813,6 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
   (interactive "P")
   (unless wl-init
     (wl-load-profile)
-    (wl-folder-init)
     (elmo-init))
   (let (demo-buf check)
     (unless wl-init
@@ -822,17 +831,19 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
                (wl-check-variables-2)
                (message "Checking type of variables...done")))
          (let ((inhibit-quit t))
-           (wl-plugged-init (wl-folder arg)))
+           (wl-plugged-init (wl-folder)))
          (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))