Commit f4dbec45 authored by Johan Bockgård's avatar Johan Bockgård

(gnus-summary-refer-thread): Don't clobber unread articles

This fixes a bug where `A T' causes "random" articles to become marked
as read.

* lisp/gnus/gnus-sum.el (gnus-summary-refer-thread): Make sure
gnus-newsgroup-unreads remains sorted.
parent bda8469b
......@@ -9068,22 +9068,24 @@ non-numeric or nil fetch the number specified by the
(regexp-opt ',(append refs (list id subject)))))))
(gnus-fetch-headers (list last) (if (numberp limit)
(* 2 limit) limit) t))))
article-ids new-unreads)
(when (listp new-headers)
(dolist (header new-headers)
(push (mail-header-number header) article-ids)
(when (member (mail-header-number header) gnus-newsgroup-unselected)
(push (mail-header-number header) gnus-newsgroup-unreads)
(setq gnus-newsgroup-unselected
(delete (mail-header-number header)
(push (mail-header-number header) article-ids))
(setq article-ids (nreverse article-ids))
(setq new-unreads
(gnus-sorted-intersection gnus-newsgroup-unselected article-ids))
(setq gnus-newsgroup-unselected
(gnus-sorted-ndifference gnus-newsgroup-unselected new-unreads))
(setq gnus-newsgroup-unreads
(gnus-sorted-nunion gnus-newsgroup-unreads new-unreads))
(setq gnus-newsgroup-headers
'list gnus-newsgroup-headers new-headers
(setq gnus-newsgroup-articles
(gnus-sorted-nunion gnus-newsgroup-articles (nreverse article-ids)))
(gnus-sorted-nunion gnus-newsgroup-articles article-ids))
(gnus-summary-limit-include-thread id)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment