+2002-01-10 Kevin Greiner <kgreiner@xpediantsolutions.com>
+
+ * gnus-agent.el (gnus-agent-expire): Do not remove article from
+ alist when keeping fetched article file.
+ (gnus-agent-retrieve-headers): When parsing response for article
+ numbers, use the same algorithm as gnus-agent-braid-nov to protect
+ against garbage in the server's response.
+
+ * gnus-int.el (gnus-request-expire-articles,
+ gnus-request-move-article): Only expire when the group's server
+ has been agentized.
+
2003-01-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-cite.el (gnus-cite-delete-overlays): Protect against
;; that no headers need to be fetched. -- Kevin
(setq articles (gnus-list-range-intersection
articles (list (cons low high)))))))
+
+ (gnus-message 10 "gnus-agent-fetch-headers: undownloaded articles are '%s'" (gnus-compress-sequence articles t))
+
(save-excursion
(set-buffer nntp-server-buffer)
(alist (list nil))
(tail-alist alist))
(while dlist
- (let ((new-completed (* 100.0 (/ (setq cnt (1+ cnt)) len))))
+ (let ((new-completed (truncate (* 100.0 (/ (setq cnt (1+ cnt)) len)))))
(when (> new-completed completed)
(setq completed new-completed)
(gnus-message 9 "%3d%% completed..." completed)))
- (let* ((entry (car dlist))
+ (let* ((entry (car dlist))
(article-number (nth 0 entry))
- (fetch-date (nth 1 entry))
- (keep (nth 2 entry))
- (marker (nth 3 entry)))
+ (fetch-date (nth 1 entry))
+ (keep (nth 2 entry))
+ (marker (nth 3 entry)))
(cond
;; Kept articles are unread, marked, or special.
)
(when marker
- (push "NOV entry removed" article)
+ (push "NOV entry removed" actions)
(goto-char marker)
(gnus-delete-line))
(push (format "Removed %s article number from article alist" type) actions))
(gnus-message 7 "gnus-agent-expire: Article %d: %s" article-number (mapconcat 'identity actions ", "))))
+ (t
+ (gnus-agent-append-to-list tail-alist (cons article-number fetch-date)))
)
;; Clean up markers as I want to recycle this buffer over several groups.
;; Get the list of articles that were fetched
(goto-char (point-min))
- (ignore-errors
- (while t
- (gnus-agent-append-to-list tail-fetched-articles (read (current-buffer)))
+ (let ((pm (point-max)))
+ (while (< (point) pm)
+ (when (looking-at "[0-9]+\t")
+ (gnus-agent-append-to-list tail-fetched-articles (read (current-buffer))))
(forward-line 1)))
;; Clip this list to the headers that will actually be returned
(gnus-get-function gnus-command-method 'request-expire-articles)
articles (gnus-group-real-name group) (nth 1 gnus-command-method)
force)))
- (when (and gnus-agent gnus-agent-cache
- (gnus-sorted-difference articles not-deleted))
- (gnus-agent-expire (gnus-sorted-difference articles not-deleted)
- group 'force))
+ (when (and gnus-agent gnus-agent-cache (gnus-agent-method-p gnus-command-method))
+ (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
+ (when expired-articles
+ (gnus-agent-expire expired-articles group 'force))))
not-deleted))
(defun gnus-request-move-article (article group server accept-function &optional last)
(result (funcall (gnus-get-function gnus-command-method 'request-move-article)
article (gnus-group-real-name group)
(nth 1 gnus-command-method) accept-function last)))
- (when (and result gnus-agent gnus-agent-cache)
+ (when (and result gnus-agent gnus-agent-cache (gnus-agent-method-p gnus-command-method))
(gnus-agent-expire (list article) group 'force))
result))