(gnus-get-newsgroup-headers): Save original value of "From:" and "Subject:"
[elisp/gnus.git-] / lisp / gnus-sum.el
index bf0ee86..829740a 100644 (file)
@@ -3245,6 +3245,11 @@ If NO-DISPLAY, don't generate a summary buffer."
                  ;; If we use dummy roots, then we have to remove the
                  ;; dummy root as well.
                  (when (eq gnus-summary-make-false-root 'dummy)
+                   ;; We go to the dummy root by going to
+                   ;; the first sub-"thread", and then one line up.
+                   (gnus-summary-goto-article
+                    (mail-header-number (caadr thread)))
+                   (forward-line -1)
                    (gnus-delete-line)
                    (gnus-data-compute-positions))
                  (setq thread (cdr thread))
@@ -4236,7 +4241,8 @@ The resulting hash table is returned, or nil if no Xrefs were found."
       (subst-char-in-region (point-min) (point-max) ?\t ?  t)
       (gnus-run-hooks 'gnus-parse-headers-hook)
       (let ((case-fold-search t)
-           in-reply-to header p lines)
+           in-reply-to header p lines
+           rawtext decoded)
        (goto-char (point-min))
        ;; Search to the beginning of the next header.  Error messages
        ;; do not begin with 2 or 3.
@@ -4265,15 +4271,27 @@ The resulting hash table is returned, or nil if no Xrefs were found."
            (progn
              (goto-char p)
              (if (search-forward "\nsubject: " nil t)
-                 (funcall
-                  gnus-unstructured-field-decoder (nnheader-header-value))
+                 (progn
+                   (setq rawtext (nnheader-header-value)
+                         decoded (funcall
+                                  gnus-unstructured-field-decoder rawtext))
+                   (if (string-equal rawtext decoded)
+                       rawtext
+                     (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
+                     decoded))
                "(none)"))
            ;; From.
            (progn
              (goto-char p)
              (if (search-forward "\nfrom: " nil t)
-                 (funcall
-                  gnus-structured-field-decoder (nnheader-header-value))
+                 (progn
+                   (setq rawtext (nnheader-header-value)
+                         decoded (funcall
+                                  gnus-structured-field-decoder rawtext))
+                   (if (string-equal rawtext decoded)
+                       rawtext
+                     (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
+                     decoded))
                "(nobody)"))
            ;; Date.
            (progn
@@ -4411,7 +4429,8 @@ The resulting hash table is returned, or nil if no Xrefs were found."
 (defun gnus-nov-parse-line (number dependencies &optional force-new)
   (let ((eol (gnus-point-at-eol))
        (buffer (current-buffer))
-       header ref id id-dep ref-dep)
+       header ref id id-dep ref-dep
+       rawtext decoded)
 
     ;; overview: [num subject from date id refs chars lines misc]
     (unwind-protect
@@ -4423,10 +4442,22 @@ The resulting hash table is returned, or nil if no Xrefs were found."
          (setq header
                (vector
                 number                 ; number
-                (funcall
-                 gnus-unstructured-field-decoder (gnus-nov-field)) ; subject
-                (funcall
-                 gnus-structured-field-decoder (gnus-nov-field)) ; from
+                (progn
+                  (setq rawtext (gnus-nov-field) ; subject
+                        decoded (funcall
+                                 gnus-unstructured-field-decoder rawtext))
+                  (if (string-equal rawtext decoded)
+                      rawtext
+                    (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
+                    decoded))
+                (progn
+                  (setq rawtext (gnus-nov-field) ; from
+                        decoded (funcall
+                                 gnus-structured-field-decoder rawtext))
+                  (if (string-equal rawtext decoded)
+                      rawtext
+                    (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
+                    decoded))
                 (gnus-nov-field)       ; date
                 (setq id (or (gnus-nov-field)
                              (nnheader-generate-fake-message-id))) ; id
@@ -8949,13 +8980,12 @@ save those articles instead."
   "mime-partial"
   "Internal method to combine message/partial messages automatically.")
 
-(ctree-set-calist-strictly
- 'mime-acting-condition
- '((type . message)(subtype . partial)
-   (method . mime-method-to-combine-message/partial-pieces)
-   (major-mode . gnus-original-article-mode)
-   (summary-buffer-exp . gnus-summary-buffer)
-   ))
+(mime-add-condition
+ 'action '((type . message)(subtype . partial)
+          (method . mime-method-to-combine-message/partial-pieces)
+          (major-mode . gnus-original-article-mode)
+          (summary-buffer-exp . gnus-summary-buffer)
+          ))
 
 (set-alist 'mime-view-partial-message-method-alist
           'gnus-original-article-mode