Account for the fact that nnimap-change-group can return t
authorDave Abrahams <dave@boostpro.com>
Sat, 1 Sep 2012 04:47:35 +0000 (21:47 -0700)
committerDave Abrahams <dave@boostpro.com>
Sat, 1 Sep 2012 04:51:32 +0000 (21:51 -0700)
lisp/ChangeLog
lisp/nnimap.el

index 900b18a..a28d86a 100644 (file)
@@ -22,8 +22,8 @@
        * gnus-registry.el (gnus-try-warping-via-registry): Don't act as though
        you've found the article when you haven't.
 
        * gnus-registry.el (gnus-try-warping-via-registry): Don't act as though
        you've found the article when you haven't.
 
-       * nnimap.el (nnimap-find-article-by-message-id): Revert 2012-06-19
-       change: "Add recent argument" by Julien Danjou
+       * nnimap.el (nnimap-find-article-by-message-id): Account for the fact that
+       nnimap-change-group can return t
 
 2012-08-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 
 2012-08-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
index 4952c4e..53bc2dd 100644 (file)
@@ -985,11 +985,13 @@ textual parts.")
 If LIMIT, first try to limit the search to the N last articles."
   (with-current-buffer (nnimap-buffer)
     (erase-buffer)
 If LIMIT, first try to limit the search to the N last articles."
   (with-current-buffer (nnimap-buffer)
     (erase-buffer)
-    (let* ((number-of-article
-           (catch 'found
-             (dolist (result (cdr (nnimap-change-group group server nil t)))
-               (when (equal "EXISTS" (cadr result))
-                 (throw 'found (car result))))))
+    (let* ((change-group-result (nnimap-change-group group server nil t))
+           (number-of-article
+            (and (listp change-group-result)
+                 (catch 'found
+                   (dolist (result (cdr change-group-result))
+                     (when (equal "EXISTS" (cadr result))
+                       (throw 'found (car result)))))))
            (sequence
             (nnimap-send-command "UID SEARCH%s HEADER Message-Id %S"
                                  (if (and limit number-of-article)
            (sequence
             (nnimap-send-command "UID SEARCH%s HEADER Message-Id %S"
                                  (if (and limit number-of-article)