Add section "Parameters for Sending".
[elisp/wanderlust.git] / wl / wl-spam.el
index 255aeda..6f549ff 100644 (file)
 Append this value to `wl-summary-mark-action-list' by `wl-spam-setup'.
 
 See `wl-summary-mark-action-list' for the detail of element."
-  :type '(repeat (string :tag "Temporary mark")
-                (symbol :tag "Set mark function")
-                (symbol :tag "Unset mark function")
-                (symbol :tag "Exec function")
-                (symbol :tag "Face symbol")
-                (string :tag "Document string"))
+  :type '(repeat (list
+                 (string :tag "Temporary mark")
+                 (symbol :tag "Action name")
+                 (symbol :tag "Argument function")
+                 (symbol :tag "Set mark function")
+                 (symbol :tag "Exec function")
+                 (symbol :tag "Face symbol")
+                 (string :tag "Document string")))
   :group 'wl-spam)
 
 (defun wl-spam-domain (folder-name)
@@ -180,11 +182,11 @@ See `wl-summary-mark-action-list' for the detail of element."
   (let ((folder (or folder wl-summary-buffer-elmo-folder))
        (number (or number (wl-summary-message-number)))
        spam)
-    (message "Cheking spam...")
+    (message "Checking spam...")
     (when (setq spam (elmo-spam-message-spam-p (elmo-spam-processor)
                                               folder number))
       (wl-summary-spam number))
-    (message "Cheking spam...done")
+    (message "Checking spam...done")
     (when (interactive-p)
       (message "No: %d is %sa spam message." number (if spam "" "not ")))))
 
@@ -293,17 +295,22 @@ See `wl-summary-mark-action-list' for the detail of element."
        (spam (setq spam-list nil))
        (good (setq good-list nil)))
       (when (or spam-list good-list)
-       (message "Registering spam...")
-       (setq total (+ (length spam-list) (length good-list)))
-       (elmo-with-progress-display (> total elmo-display-progress-threshold)
-           (elmo-spam-register total "Registering spam...")
-         (when spam-list
+       (when spam-list
+         (setq total (length spam-list))
+         (message "Registering spam...")
+         (elmo-with-progress-display (> total elmo-display-progress-threshold)
+             (elmo-spam-register total "Registering spam...")
            (elmo-spam-register-spam-messages processor folder spam-list
                                              (eq domain 'good)))
-         (when good-list
+         (message "Registering spam...done"))
+       (when good-list
+         (setq total (length good-list))
+         (message "Registering good...")
+         (elmo-with-progress-display (> total elmo-display-progress-threshold)
+             (elmo-spam-register total "Registering good...")
            (elmo-spam-register-good-messages processor folder good-list
-                                             (eq domain 'spam))))
-       (message "Registering spam...done")))
+                                             (eq domain 'spam)))
+         (message "Registering good...done"))))
     ;; execute refile messages
     (wl-summary-exec-action-refile mark-list)))
 
@@ -311,13 +318,12 @@ See `wl-summary-mark-action-list' for the detail of element."
   (let ((original (wl-message-get-original-buffer))
        (number wl-message-buffer-cur-number)
        spam)
-    (message "Cheking spam...")
-    (when (elmo-spam-buffer-spam-p (elmo-spam-processor) original)
+    (message "Checking spam...")
+    (when (setq spam (elmo-spam-buffer-spam-p (elmo-spam-processor) original))
       (with-current-buffer wl-message-buffer-cur-summary-buffer
        (wl-summary-spam number)))
-    (message "Cheking spam...done")
-    (when (interactive-p)
-      (message "No: %d is %sa spam message." number (if spam "" "not ")))))
+    (message "Checking spam...done")
+    (message "No: %d is %sa spam message." number (if spam "" "not "))))
 
 (defun wl-refile-guess-by-spam (entity)
   (when (elmo-spam-message-spam-p (elmo-spam-processor)
@@ -326,7 +332,7 @@ See `wl-summary-mark-action-list' for the detail of element."
     wl-spam-folder))
 
 (defun wl-spam-setup ()
-  (add-hook 'wl-summary-prepared-hook #'wl-summary-auto-check-spam)
+  (add-hook 'wl-summary-sync-updated-hook #'wl-summary-auto-check-spam)
   (let ((actions wl-summary-mark-action-list)
        action)
     (while actions