]> git.eshelyaron.com Git - emacs.git/commitdiff
Find correct parent for articles in gnus
authorAndrew G Cohen <cohen@andy.bu.edu>
Sat, 27 Apr 2024 01:10:44 +0000 (09:10 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 10 May 2024 13:37:33 +0000 (15:37 +0200)
* lisp/gnus/gnus-sum.el (gnus-summary-refer-parent-article): When an
article's headers have been altered, use the altered headers to find the
parent.

(cherry picked from commit e29eb0e0f18d7b1e4724c1bb26ff9718fe08548b)

lisp/gnus/gnus-sum.el

index dc66e1375ab20b9a9f90b2eead745fcef3e2b441..d4895f3c5f85c8eb7bf3765371933249ad7546bc 100644 (file)
@@ -8939,7 +8939,8 @@ The difference between N and the number of articles fetched is returned."
     (while (and (> n 0)
                (not error))
       (setq header (gnus-summary-article-header))
-      (if (and (eq (mail-header-number header)
+      (if (and (null gnus-alter-header-function)
+               (eq (mail-header-number header)
                   (cdr gnus-article-current))
               (equal gnus-newsgroup-name
                      (car gnus-article-current)))
@@ -8947,7 +8948,8 @@ The difference between N and the number of articles fetched is returned."
          ;; displayed article, then we take a look at the actual
          ;; References header, since this is slightly more
          ;; reliable than the References field we got from the
-         ;; server.
+          ;; server. But if we altered the header, we should prefer
+          ;; the version from the header vector.
          (with-current-buffer gnus-original-article-buffer
            (nnheader-narrow-to-headers)
            (unless (setq ref (message-fetch-field "references"))
@@ -8955,8 +8957,8 @@ The difference between N and the number of articles fetched is returned."
                (setq ref (gnus-extract-message-id-from-in-reply-to ref))))
            (widen))
        (setq ref
-             ;; It's not the current article, so we take a bet on
-             ;; the value we got from the server.
+              ;; It's not the current article, or we altered the header,
+              ;; so we use whats in the header vector.
              (mail-header-references header)))
       (if (and ref
               (not (equal ref "")))