nnimap.el (nnimap-find-expired-articles): nnimap `never' expiration fix
authorElias Oltmanns <eo@nebensachen.de>
Wed, 28 Jan 2015 07:01:53 +0000 (07:01 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 28 Jan 2015 07:01:53 +0000 (07:01 +0000)
lisp/ChangeLog
lisp/nnimap.el

index 52177b7..2291cb9 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-28  Elias Oltmanns  <eo@nebensachen.de>
+
+       * nnimap.el (nnimap-find-expired-articles): Fix handling of
+       (expiry-wait . never).
+
 2015-01-28  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * nnimap.el (nnimap-request-group): Clear the buffer before returning
index 205f92c..e619c0f 100644 (file)
@@ -1021,20 +1021,20 @@ textual parts.")
 
 (defun nnimap-find-expired-articles (group)
   (let ((cutoff (nnmail-expired-article-p group nil nil)))
-    (with-current-buffer (nnimap-buffer)
-      (let ((result
-            (nnimap-command
-             "UID SEARCH SENTBEFORE %s"
-             (format-time-string
-              (format "%%d-%s-%%Y"
-                      (upcase
-                       (car (rassoc (nth 4 (decode-time cutoff))
-                                    parse-time-months))))
-              cutoff))))
-       (and (car result)
-            (delete 0 (mapcar #'string-to-number
-                              (cdr (assoc "SEARCH" (cdr result))))))))))
-
+    (when cutoff
+      (with-current-buffer (nnimap-buffer)
+       (let ((result
+              (nnimap-command
+               "UID SEARCH SENTBEFORE %s"
+               (format-time-string
+                (format "%%d-%s-%%Y"
+                        (upcase
+                         (car (rassoc (nth 4 (decode-time cutoff))
+                                      parse-time-months))))
+                cutoff))))
+         (and (car result)
+              (delete 0 (mapcar #'string-to-number
+                                (cdr (assoc "SEARCH" (cdr result)))))))))))
 
 (defun nnimap-find-article-by-message-id (group server message-id
                                                &optional limit)