(defcustom nnimap-request-articles-find-limit nil
"Limit the number of articles to look for after moving an article."
:type 'integer
- :version "24.2"
+ :version "24.3"
:group 'nnimap)
(defvar nnimap-process nil)
(nnheader-ms-strip-cr)))
(cons group article)))))))
-(deffoo nnimap-request-head (article &optional group server)
+(deffoo nnimap-request-head (article &optional group server to-buffer)
(when group
(setq group (nnimap-decode-gnus-group group)))
(when (nnimap-change-group group server)
article (format "UID FETCH %%d %s"
(nnimap-header-parameters)))
(let ((buffer (current-buffer)))
- (with-current-buffer nntp-server-buffer
+ (with-current-buffer (or to-buffer nntp-server-buffer)
(erase-buffer)
(insert-buffer-substring buffer)
(nnheader-ms-strip-cr)
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)
nil t))))))
(defun nnimap-change-group (group &optional server no-reconnect read-only)
- "Change group to GROUP.
+ "Change group to GROUP if non-nil.
If SERVER is set, check that server is connected, otherwise retry
-to reconnect, unless NO-RECONNECT is set to t.
-if READ-ONLY is set, send EXAMINE rather than SELECT to the server."
+to reconnect, unless NO-RECONNECT is set to t. Return nil if
+unsuccessful in connecting.
+If GROUP is nil, return t.
+If READ-ONLY is set, send EXAMINE rather than SELECT to the server.
+Return the server's response to the SELECT or EXAMINE command.
+"
(let ((open-result t))
(when (and server
(not (nnimap-server-opened server)))