From 935498ef35a222042b0fed0e50c6d7923bf41822 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 23 Sep 2010 18:34:10 +0200 Subject: [PATCH] When UIDNEXT is present, use that for the active. That's instead of the high number, which is usually too low. --- lisp/ChangeLog | 5 +++++ lisp/nnimap.el | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 044f43859..6a2563e9f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-09-23 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-update-info): When UIDNEXT is present, use that for + the active instead of the high number, which is usually too low. + 2010-09-23 Teodor Zlatanov * netrc.el (netrc-parse): Remove encrypt.el mentions. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index fcf501d8d..73a7335ed 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -419,14 +419,11 @@ not done by default on servers that doesn't support that command.") (when info (nnimap-update-infos marks (list info))) (goto-char (point-max)) - (cond - (marks - (let ((uidnext (nth 5 (car marks)))) - (setq high (or (nth 3 (car marks)) (1- uidnext)) - low (or (nth 4 (car marks)) uidnext)))) - ((re-search-backward "UIDNEXT \\([0-9]+\\)" nil t) - (setq high (1- (string-to-number (match-string 1))) - low 1))))) + (let ((uidnext (nth 5 (car marks)))) + (setq high (if uidnext + (1- uidnext) + (nth 3 (car marks))) + low (or (nth 4 (car marks)) uidnext))))) (erase-buffer) (insert (format @@ -782,11 +779,13 @@ not done by default on servers that doesn't support that command.") (let ((group (gnus-info-group info)) (completep (and start-article (= start-article 1)))) + (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 - (if high + (if (and low high) (cons low high) ;; No articles in this group. (cons uidnext (1- uidnext)))) -- 2.25.1