summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-sum.el
diff options
context:
space:
mode:
authorJohan Bockgård <bojohan@gnu.org>2015-04-12 16:13:08 +0200
committerJohan Bockgård <bojohan@gnu.org>2015-04-12 16:13:08 +0200
commitf4dbec453dcf0586c2a7ac4b010ae12691bc215b (patch)
treef0736733f8daf6d15a9bd47dc0a97812ccff89f9 /lisp/gnus/gnus-sum.el
parentbda8469be55134d617f6a5409634758842fef15f (diff)
downloademacs-f4dbec453dcf0586c2a7ac4b010ae12691bc215b.tar.gz
(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.
Diffstat (limited to 'lisp/gnus/gnus-sum.el')
-rw-r--r--lisp/gnus/gnus-sum.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index c68d4962636..73a0d4b1039 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -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)
+ 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)
- gnus-newsgroup-unselected))))
+ (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
(gnus-delete-duplicate-headers
(gnus-merge
'list gnus-newsgroup-headers new-headers
'gnus-article-sort-by-number)))
(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)))
(gnus-summary-show-thread))