Revision: miles@gnu.org--gnu-2004/gnus--devo--0--patch-109
[gnus] / lisp / gnus-sum.el
index 725d936..d8ba10f 100644 (file)
@@ -64,7 +64,7 @@ it will be killed sometime later."
   "*Non-nil means that Gnus will try to build threads by grabbing old headers.
 If an unread article in the group refers to an older, already read (or
 just marked as read) article, the old article will not normally be
-displayed in the Summary buffer.  If this variable is non-nil, Gnus
+displayed in the Summary buffer.  If this variable is t, Gnus
 will attempt to grab the headers to the old articles, and thereby
 build complete threads.  If it has the value `some', only enough
 headers to connect otherwise loose threads will be displayed.  This
@@ -75,7 +75,9 @@ old headers will be fetched, but none will be displayed.
 The server has to support NOV for any of this to work."
   :group 'gnus-thread
   :type '(choice (const :tag "off" nil)
+                (const :tag "on" t)
                 (const some)
+                (const invisible)
                 number
                 (sexp :menu-tag "other" t)))
 
@@ -117,6 +119,7 @@ given by the `gnus-summary-same-subject' variable.)"
 
 (defcustom gnus-summary-make-false-root-always nil
   "Always make a false dummy root."
+  :version "21.4"
   :group 'gnus-thread
   :type 'boolean)
 
@@ -217,6 +220,7 @@ If this variable is nil, scoring will be disabled."
   "*Default threshold for a high scored article.
 An article will be highlighted as high scored if its score is greater
 than this score."
+  :version "21.4"
   :group 'gnus-score-default
   :type 'integer)
 
@@ -224,6 +228,7 @@ than this score."
   "*Default threshold for a low scored article.
 An article will be highlighted as low scored if its score is smaller
 than this score."
+  :version "21.4"
   :group 'gnus-score-default
   :type 'integer)
 
@@ -319,6 +324,7 @@ the first unseen article), 'unseen-or-unread' (place point on the subject
 line of the first unseen article or, if all article have been seen, on the
 subject line of the first unread article), or a function to be called to
 place point on some subject line."
+  :version "21.4"
   :group 'gnus-group-select
   :type '(choice (const best)
                 (const unread)
@@ -362,6 +368,7 @@ ignores articles whose headers have not been fetched).
 
 NOTE: The list of unfetched articles will always be nil when plugged
 and, when unplugged, a subset of the undownloaded article list."
+  :version "21.4"
   :group 'gnus-summary-maneuvering
   :type '(choice (const :tag "None" nil)
                  (const :tag "Undownloaded when unplugged" undownloaded)
@@ -375,7 +382,7 @@ current article is unread."
   :group 'gnus-summary-maneuvering
   :type 'boolean)
 
-(defcustom gnus-auto-center-summary t
+(defcustom gnus-auto-center-summary 2
   "*If non-nil, always center the current summary buffer.
 In particular, if `vertical' do only vertical recentering.  If non-nil
 and non-`vertical', do both horizontal and vertical recentering."
@@ -496,6 +503,7 @@ string with the suggested prefix."
 
 (defcustom gnus-forwarded-mark ?F
   "*Mark used for articles that have been forwarded."
+  :version "21.4"
   :group 'gnus-summary-marks
   :type 'character)
 
@@ -516,11 +524,13 @@ string with the suggested prefix."
 
 (defcustom gnus-unseen-mark ?.
   "*Mark used for articles that haven't been seen."
+  :version "21.4"
   :group 'gnus-summary-marks
   :type 'character)
 
 (defcustom gnus-no-mark ?               ;Whitespace
   "*Mark used for articles that have no other secondary mark."
+  :version "21.4"
   :group 'gnus-summary-marks
   :type 'character)
 
@@ -712,7 +722,6 @@ VALUE should have the form `(FOO nil)' or `(FOO t)', where FOO is an atom.
   :match 'gnus-widget-reversible-match
   :value-to-internal 'gnus-widget-reversible-to-internal
   :value-to-external 'gnus-widget-reversible-to-external)
-                        
 
 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
   "*List of functions used for sorting articles in the summary buffer.
@@ -950,7 +959,7 @@ automatically when it is selected."
   (and (fboundp 'display-graphic-p)
        (display-graphic-p))
   "*If non-nil, display an arrow highlighting the current article."
-  :version "21.1"
+  :version "21.4"
   :group 'gnus-summary
   :type 'boolean)
 
@@ -1128,22 +1137,23 @@ type of files to save."
 This is mostly relevant for slow back ends where the user may
 wish to widen the summary buffer to include all headers
 that were fetched.  Say, for nnultimate groups."
+  :version "21.4"
   :group 'gnus-summary
   :type '(choice boolean regexp))
 
 (defcustom gnus-summary-muttprint-program "muttprint"
   "Command (and optional arguments) used to run Muttprint."
-  :version "21.3"
+  :version "21.4"
   :group 'gnus-summary
   :type 'string)
 
-(defcustom gnus-article-loose-mime nil
+(defcustom gnus-article-loose-mime t
   "If non-nil, don't require MIME-Version header.
 Some brain-damaged MUA/MTA, e.g. Lotus Domino 5.0.6 clients, does not
-supply the MIME-Version header or deliberately strip it From the mail.
-Set it to non-nil, Gnus will treat some articles as MIME even if
-the MIME-Version header is missed."
-  :version "21.3"
+supply the MIME-Version header or deliberately strip it from the mail.
+If non-nil (the default), Gnus will treat some articles as MIME
+even if the MIME-Version header is missing."
+  :version "21.4"
   :type 'boolean
   :group 'gnus-article-mime)
 
@@ -1152,6 +1162,7 @@ the MIME-Version header is missed."
 This means that Gnus will search message bodies for text that look
 like uuencoded bits, yEncoded bits, and so on, and present that using
 the normal Gnus MIME machinery."
+  :version "21.4"
   :type 'boolean
   :group 'gnus-article-mime)
 
@@ -1469,7 +1480,6 @@ For example:
         nil
       (load "gnus-sum.el" t t t))
     (require 'gnus)
-    (require 'gnus-agent)
     (require 'gnus-art)))
 
 ;; MIME stuff.
@@ -2282,8 +2292,12 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
              ["Pipe through a filter..." gnus-summary-pipe-output t]
              ["Add to SOUP packet" gnus-soup-add-article t]
              ["Print with Muttprint..." gnus-summary-muttprint t]
-             ["Print" gnus-summary-print-article t])
-            ("Backend"
+             ["Print" gnus-summary-print-article
+              ,@(if (featurep 'xemacs) '(t)
+                  '(:help "Generate and print a PostScript image"))])
+            ("Copy, move,... (Backend)"
+             ,@(if (featurep 'xemacs) nil
+                 '(:help "Copying, moving, expiring articles..."))
              ["Respool article..." gnus-summary-respool-article t]
              ["Move article..." gnus-summary-move-article
               (gnus-check-backend-function
@@ -2374,7 +2388,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
       `("Post"
        ["Send a message (mail or news)" gnus-summary-post-news
         ,@(if (featurep 'xemacs) '(t)
-            '(:help "Post an article"))]
+            '(:help "Compose a new message (mail or news)"))]
        ["Followup" gnus-summary-followup
         ,@(if (featurep 'xemacs) '(t)
             '(:help "Post followup to this article"))]
@@ -2473,6 +2487,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
         ["Set mark" gnus-summary-mark-as-processable t]
         ["Remove mark" gnus-summary-unmark-as-processable t]
         ["Remove all marks" gnus-summary-unmark-all-processable t]
+        ["Invert marks" gnus-uu-invert-processable t]
         ["Mark above" gnus-uu-mark-over t]
         ["Mark series" gnus-uu-mark-series t]
         ["Mark region" gnus-uu-mark-region (gnus-mark-active-p)]
@@ -3601,16 +3616,10 @@ If NO-DISPLAY, don't generate a summary buffer."
       (when gnus-build-sparse-threads
        (gnus-build-sparse-threads))
       ;; Find the initial limit.
-      (if gnus-show-threads
-         (if show-all
-             (let ((gnus-newsgroup-dormant nil))
-               (gnus-summary-initial-limit show-all))
+      (if show-all
+         (let ((gnus-newsgroup-dormant nil))
            (gnus-summary-initial-limit show-all))
-       ;; When unthreaded, all articles are always shown.
-       (setq gnus-newsgroup-limit
-             (mapcar
-              (lambda (header) (mail-header-number header))
-              gnus-newsgroup-headers)))
+       (gnus-summary-initial-limit show-all))
       ;; Generate the summary buffer.
       (unless no-display
        (gnus-summary-prepare))
@@ -4080,7 +4089,7 @@ Returns HEADER if it was entered in the DEPENDENCIES.  Returns nil otherwise."
                               (setq x (nnheader-nov-field))))
                   (error x))
                 (nnheader-nov-field)   ; date
-                (nnheader-nov-read-message-id) ; id
+                (nnheader-nov-read-message-id number)  ; id
                 (setq references (nnheader-nov-field)) ; refs
                 (nnheader-nov-read-integer) ; chars
                 (nnheader-nov-read-integer) ; lines
@@ -4649,32 +4658,39 @@ Unscored articles will be counted as having a score of zero."
 (defcustom gnus-sum-thread-tree-root "> "
   "With %B spec, used for the root of a thread.
 If nil, use subject instead."
+  :version "21.4"
   :type '(radio (const :format "%v  " nil) (string :size 0))
   :group 'gnus-thread)
 (defcustom gnus-sum-thread-tree-false-root "> "
   "With %B spec, used for a false root of a thread.
 If nil, use subject instead."
+  :version "21.4"
   :type '(radio (const :format "%v  " nil) (string :size 0))
   :group 'gnus-thread)
 (defcustom gnus-sum-thread-tree-single-indent ""
   "With %B spec, used for a thread with just one message.
 If nil, use subject instead."
+  :version "21.4"
   :type '(radio (const :format "%v  " nil) (string :size 0))
   :group 'gnus-thread)
 (defcustom gnus-sum-thread-tree-vertical "| "
   "With %B spec, used for drawing a vertical line."
+  :version "21.4"
   :type 'string
   :group 'gnus-thread)
 (defcustom gnus-sum-thread-tree-indent "  "
   "With %B spec, used for indenting."
+  :version "21.4"
   :type 'string
   :group 'gnus-thread)
 (defcustom gnus-sum-thread-tree-leaf-with-other "+-> "
   "With %B spec, used for a leaf with brothers."
+  :version "21.4"
   :type 'string
   :group 'gnus-thread)
 (defcustom gnus-sum-thread-tree-single-leaf "\\-> "
   "With %B spec, used for a leaf without brothers."
+  :version "21.4"
   :type 'string
   :group 'gnus-thread)
 
@@ -5299,8 +5315,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
 
 (defun gnus-articles-to-read (group &optional read-all)
   "Find out what articles the user wants to read."
-  (let* ((display (gnus-group-find-parameter group 'display))
-        (articles
+  (let* ((articles
          ;; Select all articles if `read-all' is non-nil, or if there
          ;; are no unread articles.
          (if (or read-all
@@ -5787,7 +5802,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
         (or dependencies
             (with-current-buffer gnus-summary-buffer
               gnus-newsgroup-dependencies)))
-       headers id end ref
+       headers id end ref number
        (mail-parse-charset gnus-newsgroup-charset)
        (mail-parse-ignored-charsets
         (save-excursion (condition-case nil
@@ -5820,7 +5835,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
           (vector
            ;; Number.
            (prog1
-               (read cur)
+               (setq number (read cur))
              (end-of-line)
              (setq p (point))
              (narrow-to-region (point)
@@ -5857,7 +5872,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
                                             (match-end 1))
                         ;; If there was no message-id, we just fake one
                         ;; to make subsequent routines simpler.
-                        (nnheader-generate-fake-message-id))))
+                        (nnheader-generate-fake-message-id number))))
            ;; References.
            (progn
              (goto-char p)
@@ -6051,6 +6066,11 @@ the subject line on."
              (prog1
                  (1+ (point-at-eol))
                (gnus-delete-line))))))
+      ;; Remove list identifiers from subject.
+      (when gnus-list-identifiers
+       (let ((gnus-newsgroup-headers (list header)))
+         (gnus-summary-remove-list-identifiers)
+         (setq header (car gnus-newsgroup-headers))))
       (when old-header
        (mail-header-set-number header (mail-header-number old-header)))
       (setq gnus-newsgroup-sparse
@@ -6307,7 +6327,7 @@ displayed, no centering will be performed."
                      ((< (window-height) 7) 1)
                      (t (if (numberp gnus-auto-center-summary)
                             gnus-auto-center-summary
-                          2))))
+                           (/ (1- (window-height)) 2)))))
           (height (1- (window-height)))
           (bottom (save-excursion (goto-char (point-max))
                                   (forward-line (- height))
@@ -7152,6 +7172,7 @@ be displayed."
   (let ((mm-verify-option 'known)
        (mm-decrypt-option 'known)
        (gnus-article-emulate-mime t)
+       (mm-fill-flowed nil)
        (gnus-buttonized-mime-types (append (list "multipart/signed"
                                                  "multipart/encrypted")
                                            gnus-buttonized-mime-types)))
@@ -8441,7 +8462,7 @@ If BACKWARD, search backward instead."
   (let ((gnus-last-article gnus-last-article))
     (if (gnus-summary-search-article regexp backward)
        (gnus-summary-show-thread)
-      (error "Search failed: \"%s\"" regexp))))
+      (signal 'search-failed (list regexp)))))
 
 (defun gnus-summary-search-article-backward (regexp)
   "Search for an article containing REGEXP backward."
@@ -8879,7 +8900,7 @@ forward."
            (when (message-goto-body)
              (gnus-narrow-to-body))
            (goto-char (point-min))
-           (while (re-search-forward "·" (point-max) t)
+           (while (search-forward "·" (point-max) t)
              (replace-match "."))
            (unmorse-region (point-min) (point-max))
            (widen)
@@ -9155,8 +9176,8 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
     (gnus-set-mode-line 'summary)))
 
 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
-  "Move the current article to a different newsgroup.
-If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
+  "Copy the current article to some other group.
+If TO-NEWSGROUP is string, do not prompt for a newsgroup to copy to.
 When called interactively, if TO-NEWSGROUP is nil, use the value of
 the variable `gnus-move-split-methods' for finding a default target
 newsgroup.
@@ -9418,10 +9439,10 @@ confirmation before the articles are deleted."
        (unless (memq (car articles) not-deleted)
          (gnus-summary-mark-article (car articles) gnus-canceled-mark))
        (let* ((article (car articles))
-              (id (mail-header-id (gnus-data-header
-                                   (assoc article (gnus-data-list nil))))))
+              (ghead  (gnus-data-header
+                                   (assoc article (gnus-data-list nil)))))
          (run-hook-with-args 'gnus-summary-article-delete-hook
-                             'delete id gnus-newsgroup-name nil
+                             'delete ghead gnus-newsgroup-name nil
                              nil))
        (setq articles (cdr articles)))
       (when not-deleted