From f36869c21744af08b25be653bdbaa81617f43ef8 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 31 Aug 2012 21:47:35 -0700 Subject: [PATCH] Account for the fact that nnimap-change-group can return t --- lisp/ChangeLog | 4 ++-- lisp/nnimap.el | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 900b18aa9..a28d86ab7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. - * 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 diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 4952c4ec6..53bc2dd9f 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -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) - (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) -- 2.25.1