shr: Render td content with shr-descend
[gnus] / lisp / spam.el
index 2d2fafa..097299f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; spam.el --- Identifying spam
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -39,7 +39,7 @@
 
 ;;{{{ compilation directives and autoloads/requires
 
-;; For Emacs < 22.2.
+;; For Emacs <22.2 and XEmacs.
 (eval-and-compile
   (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 
@@ -660,12 +660,12 @@ order for SpamAssassin to recognize the new registered spam."
   :type 'string
   :group 'spam-crm114)
 
-(defcustom spam-crm114-spam-strong-switch "--UNKNOWN"
+(defcustom spam-crm114-spam-strong-switch "--unlearn"
   "The switch that CRM114 Mailfilter uses to unregister ham messages."
   :type 'string
   :group 'spam-crm114)
 
-(defcustom spam-crm114-ham-strong-switch "--UNKNOWN"
+(defcustom spam-crm114-ham-strong-switch "--unlearn"
   "The switch that CRM114 Mailfilter uses to unregister spam messages."
   :type 'string
   :group 'spam-crm114)
@@ -689,7 +689,8 @@ order for SpamAssassin to recognize the new registered spam."
   "Sx" gnus-summary-mark-as-spam
   "Mst" spam-generic-score
   "Msx" gnus-summary-mark-as-spam
-  "\M-d" gnus-summary-mark-as-spam)
+  "\M-d" gnus-summary-mark-as-spam
+  "$" gnus-summary-mark-as-spam)
 
 (defvar spam-cache-lookups t
   "Whether spam.el will try to cache lookups using `spam-caches'.")
@@ -1152,10 +1153,8 @@ backends)."
                                  'spam-check-crm114
                                  'spam-crm114-register-ham-routine
                                  'spam-crm114-register-spam-routine
-                                 ;; does CRM114 Mailfilter support unregistration?
-                                 nil
-                                 nil)
-
+                                 'spam-crm114-unregister-ham-routine
+                                 'spam-crm114-unregister-spam-routine)
 ;;}}}
 
 ;;{{{ scoring and summary formatting
@@ -1288,6 +1287,7 @@ variable.  When the processor variable is nil, just the
 classification and spam-use-* check variable are used.  This is
 superseded by the new spam backend code, so it's only consulted
 for backwards compatibility.")
+(make-obsolete-variable 'spam-list-of-processors nil "22.1")
 
 (defun spam-group-processor-p (group backend &optional classification)
   "Checks if GROUP has a BACKEND with CLASSIFICATION registered.
@@ -1607,8 +1607,7 @@ to find it out)."
        article))))
 
 (defun spam-fetch-article-header (article)
-  (save-excursion
-    (set-buffer gnus-summary-buffer)
+  (with-current-buffer gnus-summary-buffer
     (gnus-read-header article)
     (nth 3 (assq article gnus-newsgroup-data))))
 ;;}}}
@@ -2174,8 +2173,7 @@ See `spam-ifile-database'."
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name))
            (db-param (spam-get-ifile-database-parameter)))
-       (save-excursion
-         (set-buffer article-buffer-name)
+       (with-current-buffer article-buffer-name
          (apply 'call-process-region
                 (point-min) (point-max) spam-ifile-program
                 nil temp-buffer-name nil "-c"
@@ -2320,9 +2318,8 @@ With a non-nil REMOVE, remove the ADDRESSES."
     ;; else, we have a list of addresses here
     (unless (file-exists-p (file-name-directory file))
       (make-directory (file-name-directory file) t))
-    (save-excursion
-      (set-buffer
-       (find-file-noselect file))
+    (with-current-buffer
+       (find-file-noselect file)
       (dolist (a addresses)
        (when (stringp a)
          (goto-char (point-min))
@@ -2523,8 +2520,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
            return)
        (with-temp-buffer
          (let ((temp-buffer-name (buffer-name)))
-           (save-excursion
-             (set-buffer article-buffer-name)
+           (with-current-buffer article-buffer-name
              (apply 'call-process-region
                     (point-min) (point-max)
                     spam-bogofilter-program
@@ -2581,8 +2577,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
   (let ((article-buffer-name (buffer-name)))
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-       (save-excursion
-         (set-buffer article-buffer-name)
+       (with-current-buffer article-buffer-name
          (let ((status
                 (apply 'call-process-region
                        (point-min) (point-max)
@@ -2658,8 +2653,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
   (let ((article-buffer-name (buffer-name)))
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-       (save-excursion
-         (set-buffer article-buffer-name)
+       (with-current-buffer article-buffer-name
          (apply 'call-process-region
                 (point-min) (point-max) spam-assassin-program
                 nil temp-buffer-name nil spam-spamassassin-arguments))
@@ -2693,8 +2687,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
          ;; group the articles into mbox format
          (dolist (article articles)
            (let (article-string)
-             (save-excursion
-               (set-buffer summary-buffer-name)
+             (with-current-buffer summary-buffer-name
                (setq article-string (spam-get-article-as-string article)))
              (when (stringp article-string)
                (insert "From \n") ; mbox separator (sa-learn only checks the
@@ -2757,8 +2750,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
        return)
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-       (save-excursion
-         (set-buffer article-buffer-name)
+       (with-current-buffer article-buffer-name
          (apply 'call-process-region
                 (point-min) (point-max)
                 spam-bsfilter-program
@@ -2843,8 +2835,7 @@ With a non-nil REMOVE, remove the ADDRESSES."
        return)
     (with-temp-buffer
       (let ((temp-buffer-name (buffer-name)))
-       (save-excursion
-         (set-buffer article-buffer-name)
+       (with-current-buffer article-buffer-name
          (apply 'call-process-region
                 (point-min) (point-max)
                 spam-crm114-program
@@ -2943,5 +2934,4 @@ installed through `spam-necessary-extra-headers'."
 
 (provide 'spam)
 
-;; arch-tag: 07e6e0ca-ab0a-4412-b445-1f6c72a4f27f
 ;;; spam.el ends here