* spam.el (spam-list-of-processors): use nil for nonexistent processors
[gnus] / lisp / gnus.el
index c27b5f7..2377eab 100644 (file)
@@ -70,7 +70,7 @@
 ;; These belong to gnus-group.el.
 (defgroup gnus-group nil
   "Group buffers."
-  :link '(custom-manual "(gnus)The Group Buffer")
+  :link '(custom-manual "(gnus)Group Buffer")
   :group 'gnus)
 
 (defgroup gnus-group-foreign nil
 ;; These belong to gnus-sum.el.
 (defgroup gnus-summary nil
   "Summary buffers."
-  :link '(custom-manual "(gnus)The Summary Buffer")
+  :link '(custom-manual "(gnus)Summary Buffer")
   :group 'gnus)
 
 (defgroup gnus-summary-exit nil
 
 (defgroup gnus-summary-sort nil
   "Sorting the summary buffer."
-  :link '(custom-manual "(gnus)Sorting")
+  :link '(custom-manual "(gnus)Summary Sorting")
   :group 'gnus-summary)
 
 (defgroup gnus-summary-visual nil
@@ -282,7 +282,7 @@ is restarted, and sometimes reloaded."
   :link '(custom-manual "(gnus)Exiting Gnus")
   :group 'gnus)
 
-(defconst gnus-version-number "0.2"
+(defconst gnus-version-number "0.3"
   "Version number for this version of Gnus.")
 
 (defconst gnus-version (format "No Gnus v%s" gnus-version-number)
@@ -313,7 +313,6 @@ be set in `.emacs' instead."
   (defalias 'gnus-overlay-end 'overlay-end)
   (defalias 'gnus-extent-detached-p 'ignore)
   (defalias 'gnus-extent-start-open 'ignore)
-  (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
   (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
   (defalias 'gnus-character-to-event 'identity)
   (defalias 'gnus-assq-delete-all 'assq-delete-all)
@@ -937,10 +936,10 @@ be set in `.emacs' instead."
 
 (eval-when (load)
   (let ((command (format "%s" this-command)))
-    (if (and (string-match "gnus" command)
-            (not (string-match "gnus-other-frame" command)))
-       (gnus-splash)
-      (gnus-get-buffer-create gnus-group-buffer))))
+    (when (string-match "gnus" command)
+      (if (string-match "gnus-other-frame" command)
+         (gnus-get-buffer-create gnus-group-buffer)
+       (gnus-splash)))))
 
 ;;; Do the rest.
 
@@ -1100,9 +1099,8 @@ Check the NNTPSERVER environment variable and the
       (and (file-readable-p gnus-nntpserver-file)
           (with-temp-buffer
             (insert-file-contents gnus-nntpserver-file)
-            (let ((name (buffer-string)))
-              (unless (string-match "\\`[ \t\n]*$" name)
-                name))))))
+            (when (re-search-forward "[^ \t\n\r]+" nil t)
+              (match-string 0))))))
 
 (defcustom gnus-select-method
   (condition-case nil
@@ -1411,11 +1409,6 @@ cache to the full extent of the law."
   :group 'gnus-meta
   :type 'boolean)
 
-(defcustom gnus-use-grouplens nil
-  "*If non-nil, use GroupLens ratings."
-  :group 'gnus-meta
-  :type 'boolean)
-
 (defcustom gnus-keep-backlog 20
   "*If non-nil, Gnus will keep read articles for later re-retrieval.
 If it is a number N, then Gnus will only keep the last N articles
@@ -1830,6 +1823,24 @@ This only makes sense for mail groups."
    "The spam classification (spam, ham, or neither) of this group.
 When a spam group is entered, all unread articles are marked as spam.")
 
+  (gnus-define-group-parameter
+   spam-resend-to
+   :type list
+   :function-document
+   "The address to get spam resent (through spam-report-resend)."
+   :variable gnus-spam-resend-to
+   :variable-default nil
+   :variable-document
+   "The address to get spam resent (through spam-report-resend)."
+   :variable-group spam
+   :variable-type '(repeat
+                   (list :tag "Group address for resending spam"
+                         (regexp :tag "Group")
+                         (string :tag "E-mail address for resending spam (requires the spam-use-resend exit processor)")))
+   :parameter-type 'string :tag "E-mail address for resending spam (requires the spam-use-resend exit processor)"
+   :parameter-document
+   "The address to get spam resent (through spam-report-resend).")
+
   (defvar gnus-group-spam-exit-processor-ifile "ifile"
     "OBSOLETE: The ifile summary exit spam processor.")
 
@@ -1886,6 +1897,26 @@ Only applicable to non-spam (unclassified and ham) groups.")
      :value nil
      (list :tag "Spam Summary Exit Processor Choices"
           (set
+           (const :tag "Spam: Bogofilter"    (spam spam-use-bogofilter))
+           (const :tag "Spam: Blacklist"     (spam spam-use-blacklist))
+           (const :tag "Spam: Bsfilter"      (spam spam-use-bsfilter))
+           (const :tag "Spam: Gmane Report"  (spam spam-use-gmane))
+           (const :tag "Spam: Resend Message"(spam spam-use-resend))
+           (const :tag "Spam: ifile"         (spam spam-use-ifile))
+           (const :tag "Spam: Spam Oracle"   (spam spam-use-spamoracle))
+           (const :tag "Spam: Spam-stat"     (spam spam-use-stat))
+           (const :tag "Spam: SpamAssassin"  (spam spam-use-spamassassin))
+           (const :tag "Spam: CRM114"        (spam spam-use-crm114))
+           (const :tag "Ham: BBDB"           (ham spam-use-BBDB))
+           (const :tag "Ham: Bogofilter"     (ham spam-use-bogofilter))
+           (const :tag "Ham: Bsfilter"       (ham spam-use-bsfilter))
+           (const :tag "Ham: Copy"           (ham spam-use-ham-copy))
+           (const :tag "Ham: ifile"          (ham spam-use-ifile))
+           (const :tag "Ham: Spam Oracle"    (ham spam-use-spamoracle))
+           (const :tag "Ham: Spam-stat"      (ham spam-use-stat))
+           (const :tag "Ham: SpamAssassin"   (ham spam-use-spamassassin))
+           (const :tag "Ham: CRM114"         (ham spam-use-crm114))
+           (const :tag "Ham: Whitelist"      (ham spam-use-whitelist))
            (variable-item gnus-group-spam-exit-processor-ifile)
            (variable-item gnus-group-spam-exit-processor-stat)
            (variable-item gnus-group-spam-exit-processor-bogofilter)
@@ -1898,20 +1929,7 @@ Only applicable to non-spam (unclassified and ham) groups.")
            (variable-item gnus-group-ham-exit-processor-whitelist)
            (variable-item gnus-group-ham-exit-processor-BBDB)
            (variable-item gnus-group-ham-exit-processor-spamoracle)
-           (variable-item gnus-group-ham-exit-processor-copy)
-           (const :tag "Spam: Gmane Report"  (spam spam-use-gmane))
-           (const :tag "Spam: Bogofilter"    (spam spam-use-bogofilter))
-           (const :tag "Spam: Blacklist"     (spam spam-use-blacklist))
-           (const :tag "Spam: ifile"         (spam spam-use-ifile))
-           (const :tag "Spam: Spam-stat"     (spam spam-use-stat))
-           (const :tag "Spam: Spam Oracle"   (spam spam-use-spamoracle))
-           (const :tag "Ham: ifile"          (ham spam-use-ifile))
-           (const :tag "Ham: Bogofilter"     (ham spam-use-bogofilter))
-           (const :tag "Ham: Spam-stat"      (ham spam-use-stat))
-           (const :tag "Ham: Whitelist"      (ham spam-use-whitelist))
-           (const :tag "Ham: BBDB"           (ham spam-use-BBDB))
-           (const :tag "Ham: Copy"           (ham spam-use-ham-copy))
-           (const :tag "Ham: Spam Oracle"    (ham spam-use-spamoracle)))))
+           (variable-item gnus-group-ham-exit-processor-copy))))
    :function-document
    "Which spam or ham processors will be applied when the summary is exited."
    :variable gnus-spam-process-newsgroups
@@ -1928,6 +1946,25 @@ spam processing, associated with the appropriate processor."
                  (regexp :tag "Group Regexp")
                  (set 
                   :tag "Spam/Ham Summary Exit Processor"
+                  (const :tag "Spam: Bogofilter"    (spam spam-use-bogofilter))
+                  (const :tag "Spam: Blacklist"     (spam spam-use-blacklist))
+                  (const :tag "Spam: Bsfilter"      (spam spam-use-bsfilter))
+                  (const :tag "Spam: ifile"         (spam spam-use-ifile))
+                  (const :tag "Spam: Gmane Report"  (spam spam-use-gmane))
+                  (const :tag "Spam: Spam-stat"     (spam spam-use-stat))
+                  (const :tag "Spam: Spam Oracle"   (spam spam-use-spamoracle))
+                  (const :tag "Spam: SpamAssassin"  (spam spam-use-spamassassin))
+                  (const :tag "Spam: CRM114"        (spam spam-use-crm114))
+                  (const :tag "Ham: BBDB"           (ham spam-use-BBDB))
+                  (const :tag "Ham: Bogofilter"     (ham spam-use-bogofilter))
+                  (const :tag "Ham: Bsfilter"       (ham spam-use-bsfilter))
+                  (const :tag "Ham: Copy"           (ham spam-use-ham-copy))
+                  (const :tag "Ham: ifile"          (ham spam-use-ifile))
+                  (const :tag "Ham: Spam-stat"      (ham spam-use-stat))
+                  (const :tag "Ham: Spam Oracle"    (ham spam-use-spamoracle))
+                  (const :tag "Ham: SpamAssassin"   (ham spam-use-spamassassin))
+                  (const :tag "Ham: CRM114"         (ham spam-use-crm114))
+                  (const :tag "Ham: Whitelist"      (ham spam-use-whitelist))
                   (variable-item gnus-group-spam-exit-processor-ifile)
                   (variable-item gnus-group-spam-exit-processor-stat)
                   (variable-item gnus-group-spam-exit-processor-bogofilter)
@@ -1940,20 +1977,7 @@ spam processing, associated with the appropriate processor."
                   (variable-item gnus-group-ham-exit-processor-whitelist)
                   (variable-item gnus-group-ham-exit-processor-BBDB)
                   (variable-item gnus-group-ham-exit-processor-spamoracle)
-                  (variable-item gnus-group-ham-exit-processor-copy)
-                  (const :tag "Spam: Gmane Report"  (spam spam-use-gmane))
-                  (const :tag "Spam: Bogofilter"    (spam spam-use-bogofilter))
-                  (const :tag "Spam: Blacklist"     (spam spam-use-blacklist))
-                  (const :tag "Spam: ifile"         (spam spam-use-ifile))
-                  (const :tag "Spam: Spam-stat"     (spam spam-use-stat))
-                  (const :tag "Spam: Spam Oracle"   (spam spam-use-spamoracle))
-                  (const :tag "Ham: ifile"          (ham spam-use-ifile))
-                  (const :tag "Ham: Bogofilter"     (ham spam-use-bogofilter))
-                  (const :tag "Ham: Spam-stat"      (ham spam-use-stat))
-                  (const :tag "Ham: Whitelist"      (ham spam-use-whitelist))
-                  (const :tag "Ham: BBDB"           (ham spam-use-BBDB))
-                  (const :tag "Ham: Copy"           (ham spam-use-ham-copy))
-                  (const :tag "Ham: Spam Oracle"    (ham spam-use-spamoracle)))))
+                  (variable-item gnus-group-ham-exit-processor-copy))))
 
    :parameter-document
    "Which spam or ham processors will be applied when the summary is exited.")
@@ -1992,12 +2016,18 @@ spam-autodetect-recheck-messages is set.")
      (const default)
      (set :tag "Use specific methods"
          (variable-item spam-use-blacklist)
+         (variable-item spam-use-gmane-xref)
          (variable-item spam-use-regex-headers)
          (variable-item spam-use-regex-body)
          (variable-item spam-use-whitelist)
          (variable-item spam-use-BBDB)
          (variable-item spam-use-ifile)
          (variable-item spam-use-spamoracle)
+         (variable-item spam-use-crm114)
+         (variable-item spam-use-spamassassin)
+         (variable-item spam-use-spamassassin-headers)
+         (variable-item spam-use-bsfilter)
+         (variable-item spam-use-bsfilter-headers)
          (variable-item spam-use-stat)
          (variable-item spam-use-blackholes)
          (variable-item spam-use-hashcash)
@@ -2023,15 +2053,21 @@ set."
        (const default)
        (set :tag "Use specific methods"
        (variable-item spam-use-blacklist)
+       (variable-item spam-use-gmane-xref)
        (variable-item spam-use-regex-headers)
        (variable-item spam-use-regex-body)
        (variable-item spam-use-whitelist)
        (variable-item spam-use-BBDB)
        (variable-item spam-use-ifile)
        (variable-item spam-use-spamoracle)
+       (variable-item spam-use-crm114)
        (variable-item spam-use-stat)
        (variable-item spam-use-blackholes)
        (variable-item spam-use-hashcash)
+       (variable-item spam-use-spamassassin)
+       (variable-item spam-use-spamassassin-headers)
+       (variable-item spam-use-bsfilter)
+       (variable-item spam-use-bsfilter-headers)
        (variable-item spam-use-bogofilter-headers)
        (variable-item spam-use-bogofilter)))))
      :parameter-document
@@ -2209,8 +2245,7 @@ It is called with three parameters -- GROUP, LEVEL and OLDLEVEL."
                      summary-menu group-menu article-menu
                      tree-highlight menu highlight
                      browse-menu server-menu
-                     page-marker tree-menu binary-menu pick-menu
-                     grouplens-menu)
+                     page-marker tree-menu binary-menu pick-menu)
   "*Enable visual features.
 If `visual' is disabled, there will be no menus and few faces.  Most of
 the visual customization options below will be ignored.  Gnus will use
@@ -2224,8 +2259,7 @@ instance, to switch off all visual things except menus, you can say:
 Valid elements include `summary-highlight', `group-highlight',
 `article-highlight', `mouse-face', `summary-menu', `group-menu',
 `article-menu', `tree-highlight', `menu', `highlight', `browse-menu',
-`server-menu', `page-marker', `tree-menu', `binary-menu', `pick-menu',
-and `grouplens-menu'."
+`server-menu', `page-marker', `tree-menu', `binary-menu', and`pick-menu'."
   :group 'gnus-meta
   :group 'gnus-visual
   :type '(set (const summary-highlight)
@@ -2243,8 +2277,7 @@ and `grouplens-menu'."
              (const page-marker)
              (const tree-menu)
              (const binary-menu)
-             (const pick-menu)
-             (const grouplens-menu)))
+             (const pick-menu)))
 
 ;; Byte-compiler warning.
 (defvar gnus-visual)
@@ -2654,8 +2687,6 @@ gnus-registry.el will populate this if it's loaded.")
       gnus-summary-post-forward gnus-summary-wide-reply-with-original
       gnus-summary-post-forward)
      ("gnus-picon" :interactive t gnus-treat-from-picon)
-     ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
-      gnus-grouplens-mode)
      ("smiley" :interactive t smiley-region)
      ("gnus-win" gnus-configure-windows gnus-add-configuration)
      ("gnus-sum" gnus-summary-insert-line gnus-summary-read-group
@@ -2767,7 +2798,6 @@ with some simple extensions.
 %z   Article zcore (character)
 %t   Number of articles under the current thread (number).
 %e   Whether the thread is empty or not (character).
-%l   GroupLens score (string).
 %V   Total thread score (number).
 %P   The line number (number).
 %O   Download mark (character).
@@ -3216,7 +3246,7 @@ that that variable is buffer-local to the summary buffers."
 (defun gnus-generate-new-group-name (leaf)
   (let ((name leaf)
        (num 0))
-    (while (gnus-gethash name gnus-newsrc-hashtb)
+    (while (gnus-group-entry name)
       (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
     name))
 
@@ -3253,6 +3283,38 @@ that that variable is buffer-local to the summary buffers."
                                   (nth 1 method))))
       method)))
 
+(defsubst gnus-method-to-server (method)
+  (catch 'server-name
+    (setq method (or method gnus-select-method))
+
+    ;; Perhaps it is already in the cache.
+    (mapc (lambda (name-method)
+            (if (equal (cdr name-method) method)
+                (throw 'server-name (car name-method))))
+          gnus-server-method-cache)
+
+    (mapc
+     (lambda (server-alist)
+       (mapc (lambda (name-method)
+               (when (gnus-methods-equal-p (cdr name-method) method)
+                 (unless (member name-method gnus-server-method-cache)
+                   (push name-method gnus-server-method-cache))
+                 (throw 'server-name (car name-method))))
+             server-alist))
+     (let ((alists (list gnus-server-alist
+                         gnus-predefined-server-alist)))
+       (if gnus-select-method
+           (push (list (cons "native" gnus-select-method)) alists))
+       alists))
+
+    (let* ((name (if (member (cadr method) '(nil ""))
+                     (format "%s" (car method))
+                   (format "%s:%s" (car method) (cadr method))))
+           (name-method (cons name method)))
+      (unless (member name-method gnus-server-method-cache)
+        (push name-method gnus-server-method-cache))
+      name)))
+
 (defsubst gnus-server-to-method (server)
   "Map virtual server names to select methods."
   (or (and server (listp server) server)
@@ -3300,38 +3362,6 @@ that that variable is buffer-local to the summary buffers."
           (push (cons server result) gnus-server-method-cache))
        result)))
 
-(defsubst gnus-method-to-server (method)
-  (catch 'server-name
-    (setq method (or method gnus-select-method))
-
-    ;; Perhaps it is already in the cache.
-    (mapc (lambda (name-method)
-            (if (equal (cdr name-method) method)
-                (throw 'server-name (car name-method))))
-          gnus-server-method-cache)
-
-    (mapc
-     (lambda (server-alist)
-       (mapc (lambda (name-method)
-               (when (gnus-methods-equal-p (cdr name-method) method)
-                 (unless (member name-method gnus-server-method-cache)
-                   (push name-method gnus-server-method-cache))
-                 (throw 'server-name (car name-method))))
-             server-alist))
-     (let ((alists (list gnus-server-alist
-                         gnus-predefined-server-alist)))
-       (if gnus-select-method
-           (push (list (cons "native" gnus-select-method)) alists))
-       alists))
-
-    (let* ((name (if (member (cadr method) '(nil ""))
-                     (format "%s" (car method))
-                   (format "%s:%s" (car method) (cadr method))))
-           (name-method (cons name method)))
-      (unless (member name-method gnus-server-method-cache)
-        (push name-method gnus-server-method-cache))
-      name)))
-
 (defsubst gnus-server-get-method (group method)
   ;; Input either a server name, and extended server name, or a
   ;; select method, and return a select method.
@@ -3909,6 +3939,9 @@ If NEWSGROUP is nil, return the global kill file name instead."
       (setq valids (cdr valids)))
     outs))
 
+(eval-when-compile
+  (autoload 'message-y-or-n-p "message" nil nil 'macro))
+
 (defun gnus-read-group (prompt &optional default)
   "Prompt the user for a group name.
 Disallow invalid group names."
@@ -4087,4 +4120,5 @@ prompt the user for the name of an NNTP server to use."
 
 (provide 'gnus)
 
+;;; arch-tag: acebeeab-f331-4f8f-a7ea-89c58c84f636
 ;;; gnus.el ends here