From 736c78f37f2b6d20209cc4d1531c5391b203e099 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 19 Sep 2010 02:58:43 +0200 Subject: [PATCH] Return data in the nntp buffer so the agent can save it. --- lisp/ChangeLog | 5 +++++ lisp/gnus-start.el | 3 ++- lisp/nnimap.el | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 468f62193..6b6004e62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-09-19 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-finish-retrieve-group-infos): Return data in the + nntp buffer so the agent can save it. + 2010-09-18 Julien Danjou * gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index b421ceed6..18553071b 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -1808,7 +1808,8 @@ If SCAN, request a scan of that group as well." (gnus-check-backend-function 'finish-retrieve-group-infos (car method)) (or (not (gnus-agent-method-p method)) (gnus-online method))) - (gnus-finish-retrieve-group-infos method infos early-data)) + (gnus-finish-retrieve-group-infos method infos early-data) + (gnus-agent-save-active method)) ((gnus-check-backend-function 'retrieve-groups (car method)) (when (gnus-check-backend-function 'request-scan (car method)) (dolist (info infos) diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 601683e59..a19f96cb7 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -320,7 +320,7 @@ not done by default on servers that doesn't support that command.") article))) (let ((buffer (nnimap-find-process-buffer (current-buffer)))) (when (car result) - (with-current-buffer to-buffer + (with-current-buffer (or to-buffer nntp-server-buffer) (insert-buffer-substring buffer) (goto-char (point-min)) (let ((bytes (nnimap-get-length))) @@ -611,7 +611,18 @@ not done by default on servers that doesn't support that command.") (nnimap-update-infos (nnimap-flags-to-marks (nnimap-parse-flags (nreverse sequences))) - infos)))) + infos) + ;; Finally, just return something resembling an active file in + ;; the nntp buffer, so that the agent can save the info, too. + (with-current-buffer nntp-server-buffer + (erase-buffer) + (dolist (info infos) + (let* ((group (gnus-info-group info)) + (active (gnus-active group))) + (insert (format "%S %d %d y\n" + (gnus-group-real-name group) + (cdr active) + (car active))))))))) (defun nnimap-update-infos (flags infos) (dolist (info infos) -- 2.25.1