[gnus git] branch master updated: m0-11-211-g81350f1 =1= gnus-sum.el (gnus-summary-refer-thread): Don't clobber unread articles

Katsumi <[email protected]> Mon, 13 Apr 2015 00:41:08 +0200
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  81350f14c7234dec39d0fef592ee5f87901da9c1 (commit)
      from  b00d326b3b8ec2294db2ba0b455122fd80cd02bb (commit)


- Log -----------------------------------------------------------------
commit 81350f14c7234dec39d0fef592ee5f87901da9c1
Author: Johan BockgÃ¥rd <[email protected]>
Date:   Sun Apr 12 22:40:46 2015 +0000

    gnus-sum.el (gnus-summary-refer-thread): Don't clobber unread articles
    
    This fixes a bug where `A T' causes "random" articles to become marked
    as read.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ab7a2a8..651de2f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,4 +1,9 @@
-2015-04-12  João Távora  <[email protected]>
+2015-04-12  Johan BockgÃ¥rd  <[email protected]>
+
+	* gnus-sum.el (gnus-summary-refer-thread):
+	Make sure gnus-newsgroup-unreads remains sorted.
+
+2015-04-12  João Távora  <[email protected]>
 
 	Improve sexp-based movement in message-mode
 	* message.el (message--syntax-propertize): New function.
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index c68d496..73a0d4b 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/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)
+	(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
-                (delete (mail-header-number header)
-			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))
 

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    7 ++++++-
 lisp/gnus-sum.el |   18 ++++++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project