This commit was manufactured by cvs2svn to create tag 'for-semi-1_1'.
[elisp/gnus.git-] / lisp / gnus-sum.el
index 2d015f9..79e31a3 100644 (file)
@@ -37,7 +37,7 @@
 (require 'std11)
 (require 'mime-view)
 
 (require 'std11)
 (require 'mime-view)
 
-(or (string< "1" eword-decode-version)
+(or (get-unified-alist mime-acting-condition '((type . text)))
     (error "Please install latest SEMI."))
 
 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
     (error "Please install latest SEMI."))
 
 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
@@ -129,10 +129,13 @@ comparing subjects."
                 (sexp :menu-tag "on" t)))
 
 (defcustom gnus-simplify-subject-functions nil
                 (sexp :menu-tag "on" t)))
 
 (defcustom gnus-simplify-subject-functions nil
-  "*List of functions taking a string argument that simplify subjects.
-The functions are applied recursively."
+  "List of functions taking a string argument that simplify subjects.
+The functions are applied recursively.
+
+Useful functions to put in this list include: `gnus-simplify-subject-re',
+`gnus-simplify-subject-fuzzy' and `gnus-simplify-whitespace'."
   :group 'gnus-thread
   :group 'gnus-thread
-  :type '(repeat (list function)))
+  :type '(repeat function))
 
 (defcustom gnus-simplify-ignored-prefixes nil
   "*Regexp, matches for which are removed from subject lines when simplifying fuzzily."
 
 (defcustom gnus-simplify-ignored-prefixes nil
   "*Regexp, matches for which are removed from subject lines when simplifying fuzzily."
@@ -497,7 +500,7 @@ list of parameters to that command."
   :type 'boolean)
 
 (defcustom gnus-summary-dummy-line-format
   :type 'boolean)
 
 (defcustom gnus-summary-dummy-line-format
-  "*  %(:                          :%) %S\n"
+  "  %(:                          :%) %S\n"
   "*The format specification for the dummy roots in the summary buffer.
 It works along the same lines as a normal formatting string,
 with some simple extensions.
   "*The format specification for the dummy roots in the summary buffer.
 It works along the same lines as a normal formatting string,
 with some simple extensions.
@@ -580,14 +583,14 @@ Some functions you can use are `+', `max', or `min'."
   :type 'function)
 
 (defcustom gnus-summary-expunge-below nil
   :type 'function)
 
 (defcustom gnus-summary-expunge-below nil
-  "*All articles that have a score less than this variable will be expunged.
+  "All articles that have a score less than this variable will be expunged.
 This variable is local to the summary buffers."
   :group 'gnus-score-default
   :type '(choice (const :tag "off" nil)
                 integer))
 
 (defcustom gnus-thread-expunge-below nil
 This variable is local to the summary buffers."
   :group 'gnus-score-default
   :type '(choice (const :tag "off" nil)
                 integer))
 
 (defcustom gnus-thread-expunge-below nil
-  "*All threads that have a total score less than this variable will be expunged.
+  "All threads that have a total score less than this variable will be expunged.
 See `gnus-thread-score-function' for en explanation of what a
 \"thread score\" is.
 
 See `gnus-thread-score-function' for en explanation of what a
 \"thread score\" is.
 
@@ -666,7 +669,7 @@ is not run if `gnus-visual' is nil."
 
 (defcustom gnus-structured-field-decoder
   #'eword-decode-and-unfold-structured-field
 
 (defcustom gnus-structured-field-decoder
   #'eword-decode-and-unfold-structured-field
-  "*Function to decode non-ASCII characters in structured field for summary."
+  "Function to decode non-ASCII characters in structured field for summary."
   :group 'gnus-various
   :type 'function)
 
   :group 'gnus-various
   :type 'function)
 
@@ -676,7 +679,7 @@ is not run if `gnus-visual' is nil."
      (eword-decode-unstructured-field-body
       (std11-unfold-string string) 'must-unfold)
      ))
      (eword-decode-unstructured-field-body
       (std11-unfold-string string) 'must-unfold)
      ))
-  "*Function to decode non-ASCII characters in unstructured field for summary."
+  "Function to decode non-ASCII characters in unstructured field for summary."
   :group 'gnus-various
   :type 'function)
 
   :group 'gnus-various
   :type 'function)
 
@@ -720,7 +723,7 @@ automatically when it is selected."
   :type 'hook)
 
 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face
   :type 'hook)
 
 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face
-  "*Face used for highlighting the current article in the summary buffer."
+  "Face used for highlighting the current article in the summary buffer."
   :group 'gnus-summary-visual
   :type 'face)
 
   :group 'gnus-summary-visual
   :type 'face)
 
@@ -748,8 +751,15 @@ automatically when it is selected."
      . gnus-summary-high-unread-face)
     ((and (< score default) (= mark gnus-unread-mark))
      . gnus-summary-low-unread-face)
      . gnus-summary-high-unread-face)
     ((and (< score default) (= mark gnus-unread-mark))
      . gnus-summary-low-unread-face)
-    ((memq mark (list gnus-unread-mark gnus-downloadable-mark
-                     gnus-undownloaded-mark))
+    ((= mark gnus-unread-mark)
+     . gnus-summary-normal-unread-face)
+    ((and (> score default) (memq mark (list gnus-downloadable-mark
+                                            gnus-undownloaded-mark)))
+     . gnus-summary-high-unread-face)
+    ((and (< score default) (memq mark (list gnus-downloadable-mark
+                                            gnus-undownloaded-mark)))
+     . gnus-summary-low-unread-face)
+    ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark))
      . gnus-summary-normal-unread-face)
     ((> score default)
      . gnus-summary-high-read-face)
      . gnus-summary-normal-unread-face)
     ((> score default)
      . gnus-summary-high-read-face)
@@ -775,7 +785,7 @@ mark:    The articles mark."
                       face)))
 
 (defcustom gnus-alter-header-function nil
                       face)))
 
 (defcustom gnus-alter-header-function nil
-  "*Function called to allow alteration of article header structures.
+  "Function called to allow alteration of article header structures.
 The function is called with one parameter, the article header vector,
 which it may alter in any way.")
 
 The function is called with one parameter, the article header vector,
 which it may alter in any way.")
 
@@ -1367,7 +1377,6 @@ increase the score of each group you read."
     "e" gnus-article-emphasize
     "w" gnus-article-fill-cited-article
     "c" gnus-article-remove-cr
     "e" gnus-article-emphasize
     "w" gnus-article-fill-cited-article
     "c" gnus-article-remove-cr
-    "q" gnus-article-de-quoted-unreadable
     "f" gnus-article-display-x-face
     "l" gnus-summary-stop-page-breaking
     "r" gnus-summary-caesar-message
     "f" gnus-article-display-x-face
     "l" gnus-summary-stop-page-breaking
     "r" gnus-summary-caesar-message
@@ -1620,7 +1629,6 @@ increase the score of each group you read."
        ["Word wrap" gnus-article-fill-cited-article t]
        ["CR" gnus-article-remove-cr t]
        ["Show X-Face" gnus-article-display-x-face t]
        ["Word wrap" gnus-article-fill-cited-article t]
        ["CR" gnus-article-remove-cr t]
        ["Show X-Face" gnus-article-display-x-face t]
-       ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
        ["UnHTMLize" gnus-article-treat-html t]
        ["Rot 13" gnus-summary-caesar-message t]
        ["Unix pipe" gnus-summary-pipe-message t]
        ["UnHTMLize" gnus-article-treat-html t]
        ["Rot 13" gnus-summary-caesar-message t]
        ["Unix pipe" gnus-summary-pipe-message t]
@@ -2600,14 +2608,12 @@ the thread are to be displayed."
       (and (consp elem)                        ; Has to be a cons.
           (consp (cdr elem))           ; The cdr has to be a list.
           (symbolp (car elem))         ; Has to be a symbol in there.
       (and (consp elem)                        ; Has to be a cons.
           (consp (cdr elem))           ; The cdr has to be a list.
           (symbolp (car elem))         ; Has to be a symbol in there.
-          (not (memq (car elem)
-                     '(quit-config to-address to-list to-group)))
           (ignore-errors               ; So we set it.
             (make-local-variable (car elem))
             (set (car elem) (eval (nth 1 elem))))))))
 
 (defun gnus-summary-read-group (group &optional show-all no-article
           (ignore-errors               ; So we set it.
             (make-local-variable (car elem))
             (set (car elem) (eval (nth 1 elem))))))))
 
 (defun gnus-summary-read-group (group &optional show-all no-article
-                                     kill-buffer no-display)
+                                     kill-buffer no-display backward)
   "Start reading news in newsgroup GROUP.
 If SHOW-ALL is non-nil, already read articles are also listed.
 If NO-ARTICLE is non-nil, no article is selected initially.
   "Start reading news in newsgroup GROUP.
 If SHOW-ALL is non-nil, already read articles are also listed.
 If NO-ARTICLE is non-nil, no article is selected initially.
@@ -2622,6 +2628,11 @@ If NO-DISPLAY, don't generate a summary buffer."
                                  (setq show-all nil)))))
                (eq gnus-auto-select-next 'quietly))
       (set-buffer gnus-group-buffer)
                                  (setq show-all nil)))))
                (eq gnus-auto-select-next 'quietly))
       (set-buffer gnus-group-buffer)
+      ;; The entry function called above goes to the next
+      ;; group automatically, so we go two groups back
+      ;; if we are searching for the previous group.
+      (when backward
+       (gnus-group-prev-unread-group 2))
       (if (not (equal group (gnus-group-group-name)))
          (setq group (gnus-group-group-name))
        (setq group nil)))
       (if (not (equal group (gnus-group-group-name)))
          (setq group (gnus-group-group-name))
        (setq group nil)))
@@ -4362,11 +4373,11 @@ The resulting hash table is returned, or nil if no Xrefs were found."
            (progn
              (goto-char p)
              (setq id (if (re-search-forward
            (progn
              (goto-char p)
              (setq id (if (re-search-forward
-                           "^message-id: *\\(<[^\n\t> ]>\\)" nil t)
+                           "^message-id: *\\(<[^\n\t> ]+>\\)" nil t)
                           ;; We do it this way to make sure the Message-ID
                           ;; is (somewhat) syntactically valid.
                           ;; We do it this way to make sure the Message-ID
                           ;; is (somewhat) syntactically valid.
-                          (buffer-substring (match-beginning 0)
-                                            (match-end 0))
+                          (buffer-substring (match-beginning 1)
+                                            (match-end 1))
                         ;; If there was no message-id, we just fake one
                         ;; to make subsequent routines simpler.
                         (nnheader-generate-fake-message-id))))
                         ;; If there was no message-id, we just fake one
                         ;; to make subsequent routines simpler.
                         (nnheader-generate-fake-message-id))))
@@ -4659,7 +4670,8 @@ This is meant to be called in `gnus-article-internal-prepare-hook'."
       ;; article we have fetched.
       (when (and (not gnus-show-threads)
                 old-header)
       ;; article we have fetched.
       (when (and (not gnus-show-threads)
                 old-header)
-       (when (setq d (gnus-data-find (mail-header-number old-header)))
+       (when (and number
+                  (setq d (gnus-data-find (mail-header-number old-header))))
          (goto-char (gnus-data-pos d))
          (gnus-data-remove
           number
          (goto-char (gnus-data-pos d))
          (gnus-data-remove
           number
@@ -5088,6 +5100,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
   (interactive)
   (gnus-set-global-variables)
   (gnus-kill-save-kill-buffer)
   (interactive)
   (gnus-set-global-variables)
   (gnus-kill-save-kill-buffer)
+  (gnus-async-halt-prefetch)
   (let* ((group gnus-newsgroup-name)
         (quit-config (gnus-group-quit-config gnus-newsgroup-name))
         (mode major-mode)
   (let* ((group gnus-newsgroup-name)
         (quit-config (gnus-group-quit-config gnus-newsgroup-name))
         (mode major-mode)
@@ -5173,6 +5186,8 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
     (when (or no-questions
              gnus-expert-user
              (gnus-y-or-n-p "Discard changes to this group and exit? "))
     (when (or no-questions
              gnus-expert-user
              (gnus-y-or-n-p "Discard changes to this group and exit? "))
+      (gnus-async-halt-prefetch)
+      (gnus-run-hooks 'gnus-summary-prepare-exit-hook)
       ;; If we have several article buffers, we kill them at exit.
       (unless gnus-single-article-buffer
        (gnus-kill-buffer gnus-article-buffer)
       ;; If we have several article buffers, we kill them at exit.
       (unless gnus-single-article-buffer
        (gnus-kill-buffer gnus-article-buffer)
@@ -5412,7 +5427,8 @@ previous group instead."
                       (and unreads (not (zerop unreads))))
                   (gnus-summary-read-group
                    target-group nil no-article
                       (and unreads (not (zerop unreads))))
                   (gnus-summary-read-group
                    target-group nil no-article
-                   (and (buffer-name current-buffer) current-buffer)))
+                   (and (buffer-name current-buffer) current-buffer)
+                   nil backward))
              (setq entered t)
            (setq current-group target-group
                  target-group nil)))))))
              (setq entered t)
            (setq current-group target-group
                  target-group nil)))))))
@@ -5468,6 +5484,7 @@ returned."
                (if backward
                    (gnus-summary-find-prev unread)
                  (gnus-summary-find-next unread)))
                (if backward
                    (gnus-summary-find-prev unread)
                  (gnus-summary-find-next unread)))
+      (gnus-summary-show-thread)
       (setq n (1- n)))
     (when (/= 0 n)
       (gnus-message 7 "No more%s articles"
       (setq n (1- n)))
     (when (/= 0 n)
       (gnus-message 7 "No more%s articles"
@@ -6487,6 +6504,7 @@ or `gnus-select-method', no matter what backend the article comes from."
 
 (defun gnus-summary-edit-parameters ()
   "Edit the group parameters of the current group."
 
 (defun gnus-summary-edit-parameters ()
   "Edit the group parameters of the current group."
+  (interactive)
   (gnus-group-edit-group gnus-newsgroup-name 'params))
 
 (defun gnus-summary-enter-digest-group (&optional force)
   (gnus-group-edit-group gnus-newsgroup-name 'params))
 
 (defun gnus-summary-enter-digest-group (&optional force)
@@ -7135,7 +7153,7 @@ re-spool using this method."
   (gnus-summary-move-article n nil nil 'crosspost))
 
 (defcustom gnus-summary-respool-default-method nil
   (gnus-summary-move-article n nil nil 'crosspost))
 
 (defcustom gnus-summary-respool-default-method nil
-  "*Default method for respooling an article.
+  "Default method for respooling an article.
 If nil, use to the current newsgroup method."
   :type `(choice (gnus-select-method :value (nnml ""))
                 (const nil))
 If nil, use to the current newsgroup method."
   :type `(choice (gnus-select-method :value (nnml ""))
                 (const nil))
@@ -7200,7 +7218,7 @@ latter case, they will be copied into the relevant groups."
       (set-buffer (get-buffer-create " *import file*"))
       (buffer-disable-undo (current-buffer))
       (erase-buffer)
       (set-buffer (get-buffer-create " *import file*"))
       (buffer-disable-undo (current-buffer))
       (erase-buffer)
-      (insert-file-contents file)
+      (nnheader-insert-file-contents file)
       (goto-char (point-min))
       (unless (nnheader-article-p)
        ;; This doesn't look like an article, so we fudge some headers.
       (goto-char (point-min))
       (unless (nnheader-article-p)
        ;; This doesn't look like an article, so we fudge some headers.
@@ -7412,7 +7430,7 @@ groups."
       (gnus-run-hooks 'gnus-visual-mark-article-hook))))
 
 (defun gnus-summary-edit-wash (key)
       (gnus-run-hooks 'gnus-visual-mark-article-hook))))
 
 (defun gnus-summary-edit-wash (key)
-  "Perform editing command in the article buffer."
+  "Perform editing command KEY in the article buffer."
   (interactive
    (list
     (progn
   (interactive
    (list
     (progn
@@ -8085,7 +8103,8 @@ If prefix argument ALL is non-nil, all articles are marked as read."
   (interactive "P")
   (when (gnus-summary-catchup all quietly nil 'fast)
     ;; Select next newsgroup or exit.
   (interactive "P")
   (when (gnus-summary-catchup all quietly nil 'fast)
     ;; Select next newsgroup or exit.
-    (if (eq gnus-auto-select-next 'quietly)
+    (if (and (not (gnus-group-quit-config gnus-newsgroup-name))
+            (eq gnus-auto-select-next 'quietly))
        (gnus-summary-next-group nil)
       (gnus-summary-exit))))
 
        (gnus-summary-next-group nil)
       (gnus-summary-exit))))
 
@@ -9004,13 +9023,13 @@ save those articles instead."
   (gnus-summary-preview-mime-message (gnus-summary-article-number))
   )
 
   (gnus-summary-preview-mime-message (gnus-summary-article-number))
   )
 
-(autoload 'mime-combine-message/partials-automatically
+(autoload 'mime-method-to-combine-message/partial-pieces
   "mime-partial"
   "Internal method to combine message/partial messages automatically.")
 
 (set-atype 'mime-acting-condition
   "mime-partial"
   "Internal method to combine message/partial messages automatically.")
 
 (set-atype 'mime-acting-condition
-          '((type . "message/partial")
-            (method . mime-combine-message/partials-automatically)
+          '((type . message)(subtype . partial)
+            (method . mime-method-to-combine-message/partial-pieces)
             (major-mode . gnus-original-article-mode)
             (summary-buffer-exp . gnus-summary-buffer)
             ))
             (major-mode . gnus-original-article-mode)
             (summary-buffer-exp . gnus-summary-buffer)
             ))