Don't make `M-g' bug out on group with no marks.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 18 Sep 2010 19:25:29 +0000 (21:25 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 18 Sep 2010 19:25:29 +0000 (21:25 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 0657bcb..dd3b5d5 100644 (file)
@@ -2,6 +2,8 @@
 
        * nnimap.el (nnimap-update-info): When doing partial marks update, get
        the range update right.
+       (nnimap-request-group): Don't make `M-g' bug out on group with no
+       marks.
 
 2010-09-18  Julien Danjou  <julien@danjou.info>
 
index d37d234..73d873a 100644 (file)
@@ -349,15 +349,21 @@ not done by default on servers that doesn't support that command.")
                     (nnimap-parse-flags
                      (list (list group-sequence flag-sequence 1 group)))))
              (when info
-               (nnimap-update-infos marks (list info)))))
+               (nnimap-update-infos marks (list info)))
+             (goto-char (point-max))
+             (cond
+              (marks
+               (setq high (nth 3 (car marks))
+                     low (nth 4 (car marks))))
+              ((re-search-backward "UIDNEXT \\([0-9]+\\)" nil t)
+               (setq high (string-to-number (match-string 1))
+                     low 1)))))
          (erase-buffer)
-         (let ((high (nth 3 (car marks)))
-               (low (nth 4 (car marks))))
-           (insert
-            (format
-             "211 %d %d %d %S\n"
-             (1+ (- high low))
-             low high group))))
+         (insert
+          (format
+           "211 %d %d %d %S\n"
+           (1+ (- high low))
+           low high group))))
        t))))
 
 (defun nnimap-get-flags (spec)