Subject: Re: bug#72949: Gnus sometimes reports new messages but not showing them on IMAP server

From: James Thomas <[email-masked]>
Date: Wed, 18 Sep 2024 04:07:44 +0530

James Thomas wrote:

> Thank you for the patient explanation! (I blame the confusion on the on
> and off attention I gave to this). Your patch LGTM.

In fact, is the max needed? Wouldn't this work as well?

diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 7b0e42ff89d..251c69706c2 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -918,10 +918,10 @@ nnimap-request-group
 	    (nnimap-finish-retrieve-group-infos server info sequences
 						t)
 	    (setq active (nth 2 (assoc group nnimap-current-infos)))))
-	(setq active (or active '(0 . 1)))
+	(setq active (or active '(1 . 0)))
 	(erase-buffer)
 	(insert (format "211 %d %d %d %S\n"
-			(- (cdr active) (car active))
+			(1+ (- (cdr active) (car active)))
 			(car active)
 			(cdr active)
 			group))

--