From fe89760bc71a08cb3d708774e4ad42f763384d98 Mon Sep 17 00:00:00 2001 From: Andrew G Cohen Date: Thu, 31 Oct 2019 15:38:09 +0800 Subject: [PATCH] Speed up marking read messages in nnselect * lisp/gnus/nnselect.el (nnselect-request-update-info): Update the list of read messages by excluding the unread ones. Since the list of unread messages is usually shorter than the read list, this speeds things up significantly. --- lisp/gnus/nnselect.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 422d78650be..8f5cace9c2e 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -493,7 +493,9 @@ If this variable is nil, or if the provided function returns nil, (artids (cl-sort nartids '< :key 'car)) (group-info (gnus-get-info artgroup)) (marks (gnus-info-marks group-info)) - (read (gnus-uncompress-sequence (gnus-info-read group-info)))) + (unread (gnus-uncompress-sequence + (gnus-range-difference (gnus-active artgroup) + (gnus-info-read group-info))))) (gnus-atomic-progn (gnus-info-set-read info @@ -502,7 +504,7 @@ If this variable is nil, or if the provided function returns nil, (delq nil (mapcar #'(lambda (art) - (when (memq (cdr art) read) (car art))) + (unless (memq (cdr art) unread) (car art))) artids)))) (pcase-dolist (`(,type . ,range) marks) (setq range (gnus-uncompress-sequence range)) -- 2.39.5