X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnimap.el;h=6de49eb6cefaa8dc2c523145b84402ae3c47eac6;hb=530c9fe9d00f3eb2e8ab4fee30d7161fd3fbb78d;hp=b50d656aa2588ea65d29597d0876ba3a991fd450;hpb=7fa6b3db3cebd6fa64684f1cd4535653501f22bb;p=gnus diff --git a/lisp/nnimap.el b/lisp/nnimap.el index b50d656aa..6de49eb6c 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1230,27 +1230,26 @@ textual parts.") (when uidnext (setq high (1- uidnext))) ;; First set the active ranges based on high/low. - (if (or completep - (not (gnus-active group))) - (gnus-set-active group - (cond - (active - (cons (min (or low (car active)) - (car active)) - (max (or high (cdr active)) - (cdr active)))) - ((and low high) - (cons low high)) - (uidnext - ;; No articles in this group. - (cons uidnext (1- uidnext))) - (start-article - (cons start-article (1- start-article))) - (t - ;; No articles and no uidnext. - nil))) - (gnus-set-active - group + (gnus-set-active + group + (if (or completep + (not (gnus-active group))) + (cond + (active + (cons (min (or low (car active)) + (car active)) + (max (or high (cdr active)) + (cdr active)))) + ((and low high) + (cons low high)) + (uidnext + ;; No articles in this group. + (cons uidnext (1- uidnext))) + (start-article + (cons start-article (1- start-article))) + (t + ;; No articles and no uidnext. + nil)) (cons (car active) (or high (1- uidnext))))) ;; See whether this is a read-only group. @@ -1316,6 +1315,16 @@ textual parts.") (when new-marks (push (cons (car type) new-marks) marks))))) (gnus-info-set-marks info marks t)))) + ;; Tell Gnus whether there are any \Recent messages in any of + ;; the groups. + (let ((recent (cdr (assoc '%Recent flags)))) + (when (and active recent) + (while recent + (when (> (car recent) (cdr active)) + (push (list (cons (gnus-group-real-name group) 0)) + nnmail-split-history) + (setq recent nil)) + (pop recent)))) ;; Note the active level for the next run-through. (gnus-group-set-parameter info 'active (gnus-active group)) (gnus-group-set-parameter info 'uidvalidity uidvalidity)