- (let ((data gnus-newsgroup-data)
- number d)
- (while (setq d (pop data))
- (when (and (intern-soft (mail-header-id (gnus-data-header d))
- gnus-dup-hashtb)
- (gnus-data-unread-p d))
- (setq gnus-newsgroup-unreads
- (delq (setq number (gnus-data-number d)) gnus-newsgroup-unreads))
- (push (cons number gnus-duplicate-mark)
- gnus-newsgroup-reads))))
+ (let ((auto (and gnus-newsgroup-auto-expire
+ (memq gnus-duplicate-mark gnus-auto-expirable-marks)))
+ number)
+ (dolist (header gnus-newsgroup-headers)
+ (when (and (intern-soft (mail-header-id header) gnus-dup-hashtb)
+ (gnus-summary-article-unread-p (mail-header-number header)))
+ (setq gnus-newsgroup-unreads
+ (delq (setq number (mail-header-number header))
+ gnus-newsgroup-unreads))
+ (if (not auto)
+ (push (cons number gnus-duplicate-mark) gnus-newsgroup-reads)
+ (push number gnus-newsgroup-expirable)
+ (push (cons number gnus-expirable-mark) gnus-newsgroup-reads)))))