Synch to No Gnus 200504221124.
[elisp/gnus.git-] / lisp / gnus.el
index 311227c..d8b38fc 100644 (file)
@@ -1,7 +1,7 @@
 ;;; gnus.el --- a newsreader for GNU Emacs
 
 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997,
-;; 1998, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -321,7 +321,8 @@ be set in `.emacs' instead."
   (defvar gnus-mode-line-image-cache t)
   (if (fboundp 'find-image)
       (defun gnus-mode-line-buffer-identification (line)
-       (let ((str (car-safe line)))
+       (let ((str (car-safe line))
+             (load-path (mm-image-load-path)))
          (if (and (stringp str)
                   (string-match "^Gnus:" str))
              (progn (add-text-properties
@@ -876,7 +877,7 @@ be set in `.emacs' instead."
         (display-graphic-p)
         (let* ((bg (face-background 'default))
                (fg (face-foreground 'gnus-splash-face))
-               (data-directory (nnheader-find-etc-directory "gnus"))
+               (data-directory (nnheader-find-etc-directory "images/gnus"))
                (image (find-image
                        `((:type xpm :file "gnus.xpm"
                                 :color-symbols
@@ -987,7 +988,7 @@ For example:
      (\"mail\\\\.me\" (gnus-use-scoring  t))
      (\"list\\\\..*\" (total-expire . t)
                  (broken-reply-to . t)))"
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-group-various
   :type '(repeat (cons regexp
                       (repeat sexp))))
@@ -1347,6 +1348,7 @@ If the default site is too slow, try one of these:
                        (gnus-replace-in-string name "\\." "-") "-charter.html")))
   "*An alist of (HIERARCHY . FORM) pairs used to construct the URL of a charter.
 When FORM is evaluated `name' is bound to the name of the group."
+  :version "22.1"
   :group 'gnus-group-various
   :type '(repeat (cons (string :tag "Hierarchy") (sexp :tag "Form"))))
 
@@ -1354,6 +1356,7 @@ When FORM is evaluated `name' is bound to the name of the group."
   "*Non-nil means that control messages are displayed using `browse-url'.
 Otherwise they are fetched with ange-ftp and displayed in an ephemeral
 group."
+  :version "22.1"
   :group 'gnus-group-various
   :type 'boolean)
 
@@ -1808,7 +1811,7 @@ total number of articles in the group.")
                  (list
                   (regexp :tag "Group Name Regular Expression")
                   (boolean :tag "Ignored")))
+
  :parameter-type '(boolean :tag "Group Ignored by the Registry")
  :parameter-document
  "Whether the Gnus Registry should ignore this group.")
@@ -1817,6 +1820,7 @@ total number of articles in the group.")
 (defcustom gnus-install-group-spam-parameters t
   "*Disable the group parameters for spam detection.
 Enable if `G c' in XEmacs is giving you trouble, and make sure to submit a bug report."
+  :version "22.1"
   :type 'boolean
   :group 'gnus-start)
 
@@ -1844,11 +1848,12 @@ registry.")
    :variable gnus-spam-newsgroup-contents
    :variable-default nil
    :variable-document
-   "*Groups in which to automatically mark new articles as spam on
-summary entry.  If non-nil, this should be a list of group name
-regexps that should match all groups in which to do automatic spam
-tagging, associated with a classification (spam, ham, or neither).
-This only makes sense for mail groups."
+   "*Group classification (spam, ham, or neither).  Only
+meaningful when spam.el is loaded.  If non-nil, this should be a
+list of group name regexps associated with a classification for
+each one.  In spam groups, new articles are marked as spam on
+summary entry.  There is other behavior associated with ham and
+no classification when spam.el is loaded - see the manual."
    :variable-group spam
    :variable-type '(repeat
                    (list :tag "Group contents spam/ham classification"
@@ -1865,7 +1870,9 @@ This only makes sense for mail groups."
                                  (const :tag "Unclassified" nil)))
    :parameter-document
    "The spam classification (spam, ham, or neither) of this group.
-When a spam group is entered, all unread articles are marked as spam.")
+When a spam group is entered, all unread articles are marked as
+spam.  There is other behavior associated with ham and no
+classification when spam.el is loaded - see the manual.")
 
   (gnus-define-group-parameter
    spam-resend-to
@@ -1953,8 +1960,8 @@ Only applicable to non-spam (unclassified and ham) groups.")
   (gnus-define-group-parameter
    spam-process
    :type list
-   :parameter-type 
-   '(choice 
+   :parameter-type
+   '(choice
      :tag "Spam Summary Exit Processor"
      :value nil
      (list :tag "Spam Summary Exit Processor Choices"
@@ -2003,11 +2010,11 @@ a backend on summary exit.  If non-nil, this should be a list of group
 name regexps that should match all groups in which to do automatic
 spam processing, associated with the appropriate processor."
    :variable-group spam
-   :variable-type 
+   :variable-type
    '(repeat :tag "Spam/Ham Processors"
            (list :tag "Spam Summary Exit Processor Choices"
                  (regexp :tag "Group Regexp")
-                 (set 
+                 (set
                   :tag "Spam/Ham Summary Exit Processor"
                   (const :tag "Spam: Bogofilter"    (spam spam-use-bogofilter))
                   (const :tag "Spam: Blacklist"     (spam spam-use-blacklist))
@@ -2050,7 +2057,7 @@ spam processing, associated with the appropriate processor."
   (gnus-define-group-parameter
    spam-autodetect
    :type list
-   :parameter-type 
+   :parameter-type
    '(boolean :tag "Spam autodetection")
    :function-document
    "Should spam be autodetected (with spam-split) in this group?"
@@ -2061,7 +2068,7 @@ spam processing, associated with the appropriate processor."
    Only unseen articles will be examined, unless
    spam-autodetect-recheck-messages is set."
    :variable-group spam
-   :variable-type 
+   :variable-type
    '(repeat
      :tag "Autodetection setting"
      (list
@@ -2075,7 +2082,7 @@ spam-autodetect-recheck-messages is set.")
   (gnus-define-group-parameter
    spam-autodetect-methods
    :type list
-   :parameter-type 
+   :parameter-type
    '(choice :tag "Spam autodetection-specific methods"
      (const none)
      (const default)
@@ -2108,7 +2115,7 @@ Requires the spam-autodetect parameter.  Only unseen articles
 will be examined, unless spam-autodetect-recheck-messages is
 set."
    :variable-group spam
-   :variable-type 
+   :variable-type
    '(repeat
      :tag "Autodetection methods"
      (list
@@ -2136,7 +2143,7 @@ set."
        (variable-item spam-use-bogofilter-headers)
        (variable-item spam-use-bogofilter)))))
      :parameter-document
-   "Spam autodetection methods.  
+   "Spam autodetection methods.
 Requires the spam-autodetect parameter.  Only unseen articles
 will be examined, unless spam-autodetect-recheck-messages is
 set.")
@@ -2144,7 +2151,7 @@ set.")
   (gnus-define-group-parameter
    spam-process-destination
    :type list
-   :parameter-type 
+   :parameter-type
    '(choice :tag "Destination for spam-processed articles at summary exit"
            (string :tag "Move to a group")
            (repeat :tag "Move to multiple groups"
@@ -2162,7 +2169,7 @@ to do spam-processed article moving, associated with the destination
 group or nil for explicit expiration.  This only makes sense for
 mail groups."
    :variable-group spam
-   :variable-type 
+   :variable-type
    '(repeat
      :tag "Spam-processed articles destination"
      (list
@@ -2175,11 +2182,11 @@ mail groups."
        (const :tag "Expire" nil))))
    :parameter-document
    "Where spam-processed articles will go at summary exit.")
-  
+
   (gnus-define-group-parameter
    ham-process-destination
    :type list
-   :parameter-type 
+   :parameter-type
    '(choice
      :tag "Destination for ham articles at summary exit from a spam group"
      (string :tag "Move to a group")
@@ -2199,7 +2206,7 @@ to do ham article moving, associated with the destination
 group or nil for explicit ignoring.  This only makes sense for
 mail groups, and only works in spam groups."
    :variable-group spam
-   :variable-type 
+   :variable-type
    '(repeat
      :tag "Ham articles destination"
      (list
@@ -2383,7 +2390,7 @@ face."
 When set, Gnus will prefer using the locally stored content rather
 than re-fetching it from the server.  You also need to enable
 `gnus-agent' for this to have any affect."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-agent
   :type 'boolean)
 
@@ -2402,7 +2409,7 @@ covered by that variable."
 You may customize gnus-agent to disable its use.  However, some
 back ends have started to use the agent as a client-side cache.
 Disabling the agent may result in noticeable loss of performance."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-agent
   :type 'boolean)
 
@@ -2426,27 +2433,51 @@ This should be an alist for Emacs, or a plist for XEmacs."
                         (symbol :tag "Parameter")
                         (sexp :tag "Value")))))
 
-(defcustom gnus-user-agent 'gnus-mime-edit
+(defcustom gnus-user-agent '(emacs gnus mime config mule)
   "Which information should be exposed in the User-Agent header.
 
-It can be one of the symbols `gnus' \(show only Gnus version\), `emacs-gnus'
-\(show only Emacs and Gnus versions\), `emacs-gnus-config' \(same as
-`emacs-gnus' plus system configuration\), `emacs-gnus-type' \(same as
-`emacs-gnus' plus system type\), `gnus-mime-edit' \(show Gnus version and
-MIME Edit User-Agent\) or a custom string.  If you set it to a string,
-be sure to use a valid format, see RFC 2616."
-  :version "21.4"
+Can be a list of symbols or a string.  Valid symbols are `gnus' (show
+Gnus version), `emacs' (show Emacs version) and `mime' (show SEMI,
+FLIM and APEL versions).  In addition to the Emacs version, you can
+add `codename' (show (S)XEmacs codename), `mule' (show Mule version
+and also Meadow version if it exists) or either `config' (show system
+configuration) or `type' (show system type).  If you set it to a
+string, be sure to use a valid format, see RFC 2616."
+
+  :version "22.1"
   :group 'gnus-message
-  :type '(choice
-         (item :tag "Show Gnus version and MIME Edit User-Agent"
-               gnus-mime-edit)
-         (item :tag "Show Gnus and Emacs versions and system type"
-               emacs-gnus-type)
-         (item :tag "Show Gnus and Emacs versions and system configuration"
-               emacs-gnus-config)
-         (item :tag "Show Gnus and Emacs versions" emacs-gnus)
-         (item :tag "Show only Gnus version" gnus)
-         (string :tag "Other")))
+  :type '(choice (list (set :format "%v" :inline t
+                           (const gnus  :tag "Gnus version")
+                           (const emacs :tag "Emacs version")
+                           (choice :tag "system"
+                                   (const type   :tag "system type")
+                                   (const config :tag "system configuration"))
+                           (const codename :tag "Emacs codename")
+                           (const mime :tag "SEMI and FLIM versions")
+                           (const mule
+                                  :tag "Mule version (and Meadow version)")))
+                (string :format "%t:\n%v")))
+
+;; Convert old (< 2005-01-10) symbol type values:
+(when (symbolp gnus-user-agent)
+  (setq gnus-user-agent
+       (cond ((eq gnus-user-agent 'gnus-mime-edit)
+              '(emacs gnus mime config mule))
+             ((eq gnus-user-agent 'emacs-gnus-config)
+              '(emacs gnus config))
+             ((eq gnus-user-agent 'emacs-gnus-type)
+              '(emacs gnus type))
+             ((eq gnus-user-agent 'emacs-gnus)
+              '(emacs gnus))
+             ((eq gnus-user-agent 'gnus)
+              '(gnus))
+             (t gnus-user-agent)))
+  (gnus-message 1 "Converted `gnus-user-agent' to `%s'." gnus-user-agent)
+  (sit-for 1)
+  (if (get 'gnus-user-agent 'saved-value)
+      (customize-save-variable 'gnus-user-agent gnus-user-agent)
+    (gnus-message 1 "Edit your init file to make this change permanent.")
+    (sit-for 2)))
 
 \f
 ;;; Internal variables
@@ -2865,7 +2896,7 @@ gnus-registry.el will populate this if it's loaded.")
      ("international/mw32misc" define-process-argument-editing
       general-process-argument-editing-function)
      ("gnus-agent" gnus-open-agent gnus-agent-get-function
-      gnus-agent-save-groups gnus-agent-save-active gnus-agent-method-p
+      gnus-agent-save-active gnus-agent-method-p
       gnus-agent-get-undownloaded-list gnus-agent-fetch-session
       gnus-summary-set-agent-mark gnus-agent-save-group-info
       gnus-agent-request-article gnus-agent-retrieve-headers)
@@ -3459,7 +3490,7 @@ that that variable is buffer-local to the summary buffers."
               ;; gnus-server-method-cache so this only happens once,
               ;; if at all.
               (let (match)
-                (mapcar 
+                (mapcar
                  (lambda (info)
                    (let ((info-method (gnus-info-method info)))
                      (unless (stringp info-method)
@@ -4123,10 +4154,10 @@ Allow completion over sensible values."
 (defun gnus-agent-method-p (method)
   "Say whether METHOD is covered by the agent."
   (or (eq (car gnus-agent-method-p-cache) method)
-      (setq gnus-agent-method-p-cache 
+      (setq gnus-agent-method-p-cache
             (cons method
-                  (member (if (stringp method) 
-                              method 
+                  (member (if (stringp method)
+                              method
                             (gnus-method-to-server method)) gnus-agent-covered-methods))))
   (cdr gnus-agent-method-p-cache))