(wl-summary-test-spam): Call `wl-summary-unmark-spam' for the message not
authorokazaki <okazaki>
Tue, 16 Feb 2010 05:04:45 +0000 (05:04 +0000)
committerokazaki <okazaki>
Tue, 16 Feb 2010 05:04:45 +0000 (05:04 +0000)
 classified as spam.
(wl-summary-test-spam-messages): New function.
(wl-summary-test-spam-region): Use `wl-summary-test-spam-messages' instead of
 `wl-spam-map-spam-messages'.

doc/wl-ja.texi
doc/wl.texi
wl/ChangeLog
wl/wl-spam.el

index 6f728fa..0c140f4 100644 (file)
@@ -7100,7 +7100,7 @@ non-spam \e$B$H$7$F$N3X=,$K2C$($F!"\e(Bspam \e$B$K9T$J$C$?3X=,$r:o=|$7$^$9!#\e(B
 @kindex k c (Summary)
 @findex wl-summary-test-spam
 \e$B%+!<%=%k9T$N%a%C%;!<%8$r%F%9%H$7!"\e(Bspam \e$B$HH=Dj$5$l$?>l9g$K\e(B spam \e$B%^!<%/$r\e(B
-\e$BIU$1$^$9!#\e(B
+\e$BIU$1$^$9!#\e(Bspam \e$B$G$J$$$HH=Dj$5$l$?>l9g$O\e(B spam \e$B%^!<%/$r<h$j=|$-$^$9!#\e(B
 
 @item k C
 @kindex k C (Summary)
@@ -7139,7 +7139,7 @@ spam \e$B$+$I$&$+$N%F%9%H$r9T$$$^$9!#\e(Bspam \e$B$HH=Dj$5$l$?%a%C%;!<%8$K$O!"\e(Bsp
 @kindex r k c (Summary)
 @findex wl-summary-test-spam-region
 \e$B;XDj%j!<%8%g%s$K$"$k%a%C%;!<%8$r%F%9%H$7!"\e(Bspam \e$B$HH=Dj$5$l$?>l9g$K\e(B spam \e$B%^!<%/$r\e(B
-\e$BIU$1$^$9!#\e(B
+\e$BIU$1$^$9!#\e(Bspam \e$B$G$J$$$HH=Dj$5$l$?>l9g$O\e(B spam \e$B%^!<%/$r<h$j=|$-$^$9!#\e(B
 
 @item t k m
 @kindex t k m (Summary)
@@ -7153,6 +7153,7 @@ prefix argument \e$B$D$-$J$i$P%+!<%=%k9T$,$"$k%a%C%;!<%8$r4^$`%9%l%C%IA4$F$K\e(B
 @findex wl-thread-test-spam
 \e$B%+!<%=%k9T$,$"$k%a%C%;!<%8$r@hF,$H$9$k%9%l%C%I$N%a%C%;!<%8$r%F%9%H$7!"\e(B
 spam \e$B$HH=Dj$5$l$?>l9g$K\e(B spam \e$B%^!<%/$rIU$1$^$9!#\e(B
+spam \e$B$G$J$$$HH=Dj$5$l$?>l9g$O\e(B spam \e$B%^!<%/$r<h$j=|$-$^$9!#\e(B
 prefix argument \e$B$D$-$J$i$P%+!<%=%k9T$,$"$k%a%C%;!<%8$r4^$`%9%l%C%IA4$F$K\e(B
 \e$BE,MQ$7$^$9!#\e(B
 
index e09414c..f2517c2 100644 (file)
@@ -7158,6 +7158,7 @@ Put spam mark (@samp{s}) on current message.
 @kindex k c (Summary)
 @findex wl-summary-test-spam
 Test current message and put spam mark if judged as spam.
+Remove spam mark if judged as non-spam.
 
 @item k C
 @kindex k C (Summary)
@@ -7195,6 +7196,7 @@ Put spam mark on messages in the specified region.
 @kindex r k c (Summary)
 @findex wl-summary-test-spam-region
 Test messages in the specified region and put spam mark if judged as spam.
+Remove spam mark if judged as non-spam.
 
 @item t k m
 @kindex t k m (Summary)
@@ -7206,8 +7208,8 @@ With prefix argument, it affects on the all messages in the thread tree.
 @kindex t k c (Summary)
 @findex wl-thread-test-spam
 Test messages which are the descendant of the current thread and put spam mark
-if judged as spam.  With prefix argument, it affects on the all messages in
-the thread tree.
+if judged as spam.  Remove spam mark if judged as non-spam.
+With prefix argument, it affects on the all messages in the thread tree.
 
 @item m k
 @kindex m k (Summary)
index 7ece384..23a38c1 100644 (file)
@@ -1,3 +1,11 @@
+2010-02-16  Tetsurou Okazaki  <okazaki@be.to>
+
+       * wl-spam.el (wl-summary-test-spam): Call `wl-summary-unmark-spam'
+       for the message not classified as spam.
+       (wl-summary-test-spam-messages): New function.
+       (wl-summary-test-spam-region): Use `wl-summary-test-spam-messages'
+       instead of `wl-spam-map-spam-messages'.
+
 2010-02-08  Tetsurou Okazaki  <okazaki@be.to>
 
        * wl-action.el (wl-summary-action-unmark-docstring): New inline function.
index 8c94de0..2464ac4 100644 (file)
@@ -206,7 +206,8 @@ See `wl-summary-mark-action-list' for the detail of element."
 
 (eval-when-compile
   ;; Avoid compile warnings
-  (defalias-maybe 'wl-summary-spam 'ignore))
+  (defalias-maybe 'wl-summary-spam 'ignore)
+  (defalias-maybe 'wl-summary-unmark-spam 'ignore))
 
 (defun wl-summary-test-spam (&optional folder number)
   (interactive)
@@ -214,20 +215,32 @@ See `wl-summary-mark-action-list' for the detail of element."
        (number (or number (wl-summary-message-number)))
        spam)
     (message "Checking spam...")
-    (when (setq spam (elmo-spam-message-spam-p (elmo-spam-processor)
-                                              folder number))
-      (wl-summary-spam number))
+    (if (setq spam (elmo-spam-message-spam-p (elmo-spam-processor)
+                                            folder number))
+       (wl-summary-spam number)
+      (wl-summary-unmark-spam number))
     (message "Checking spam...done")
     (when (interactive-p)
       (message "No: %d is %sa spam message." number (if spam "" "not ")))))
 
+(defun wl-summary-test-spam-messages (folder numbers &rest args)
+  (elmo-with-progress-display (elmo-spam-check-spam (length numbers))
+      "Checking spam"
+    (let* ((spams (elmo-spam-list-spam-messages (elmo-spam-processor)
+                                               folder
+                                               numbers))
+          (goods (car (elmo-list-diff numbers spams))))
+      (dolist (number spams)
+       (wl-summary-spam number args))
+      (dolist (number goods)
+       (wl-summary-unmark-spam number)))))
+
 (defun wl-summary-test-spam-region (beg end)
   (interactive "r")
   (let ((numbers (wl-summary-collect-numbers-region beg end)))
     (cond (numbers
-          (wl-spam-map-spam-messages wl-summary-buffer-elmo-folder
-                                     numbers
-                                     #'wl-summary-spam))
+          (wl-summary-test-spam-messages wl-summary-buffer-elmo-folder
+                                         numbers))
          ((interactive-p)
           (message "No message to test.")))))