From 9ee2d9f92a9097c468fb4e938a14b2f569feb453 Mon Sep 17 00:00:00 2001 From: Elias Oltmanns Date: Thu, 29 Jan 2015 01:20:00 +0000 Subject: [PATCH] [Backport] lisp/gnus/nnimap.el (nnimap-find-expired-articles): nnimap `never' expiration fix --- lisp/gnus/ChangeLog | 7 ++++++- lisp/gnus/nnimap.el | 27 ++++++++++++++------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2bdbfcc5c23..d0a68b7f0ce 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,10 +1,15 @@ +2015-01-28 Elias Oltmanns + + * nnimap.el (nnimap-find-expired-articles): Fix handling of + (expiry-wait . never). + 2014-12-19 Andreas Schwab * gnus-group.el (gnus-read-ephemeral-bug-group): Bind coding-system-for-read and coding-system-for-write only around with-temp-file, and make buffer unibyte. Don't write temp file twice. -2014-11-26 John Mastro (tiny change) +2014-11-26 John Mastro (tiny change) * auth-source.el (auth-source-macos-keychain-search-items): Return result of `auth-source-macos-keychain-result-append' (bug#19074). diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 8ed5143b243..199cf4eb740 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -979,19 +979,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 -- 2.39.2