From: Andrew G Cohen Date: Sat, 6 May 2017 13:24:37 +0000 (+0800) Subject: Fix pushing marks on nnselect exit X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=344448609d43825e37d721264d3dc3a6aff8c16c;p=emacs.git Fix pushing marks on nnselect exit * lisp/gnus/nnselect.el (nnselect-push-info): Deal with scoring. Ensure that mark lists are properly compressed before saving. Add only the group-specific articles to the `seen' lists. --- diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 44975282719..b8aa941e8c5 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -679,6 +679,7 @@ originating groups." (select-reads (numbers-by-group (gnus-uncompress-range (gnus-info-read (gnus-get-info group))))) + (select-unseen (numbers-by-group gnus-newsgroup-unseen)) (gnus-newsgroup-active nil) mark-list type-list) (pcase-dolist (`(,mark . ,type) gnus-article-mark-lists) @@ -705,18 +706,33 @@ originating groups." artlist) select-type))) + (when list + ;; Get rid of the entries of the articles that have the + ;; default score. + (when (and (eq type 'score) + gnus-save-score + list) + (let* ((arts list) + (prev (cons nil list)) + (all prev)) + (while arts + (if (or (not (consp (car arts))) + (= (cdar arts) gnus-summary-default-score)) + (setcdr prev (cdr arts)) + (setq prev arts)) + (setq arts (cdr arts))) + (setq list (cdr all))))) + + (when (or (eq (gnus-article-mark-to-type type) 'list) + (eq (gnus-article-mark-to-type type) 'range)) + (setq list + (gnus-compress-sequence (sort list '<) t))) + ;; When exiting the group, everything that's previously been ;; unseen is now seen. (when (eq type 'seen) - (setq list (gnus-range-add list gnus-newsgroup-unseen))) - - ;; (when (or (eq (gnus-article-mark-to-type type) 'list) - ;; (eq (gnus-article-mark-to-type type) 'range)) - ;; (setq list (gnus-compress-sequence (sort list '<) t))) - - (when (eq (gnus-article-mark-to-type type) 'list) - (setq list - (gnus-compress-sequence (sort list '<) t))) + (setq list (gnus-range-add + list (cadr (assoc artgroup select-unseen))))) (when (or list (eq type 'unexist)) (push (cons type list) newmarked))))