- (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))