From fb8e9c2df9b6b204e81f6189324b8ddae69b4518 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sat, 11 Jan 2003 10:52:44 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 12 ++++++++++++ lisp/gnus-agent.el | 24 +++++++++++++++--------- lisp/gnus-int.el | 10 +++++----- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 995ce95..efdaa6e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2002-01-10 Kevin Greiner + + * 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 * gnus-cite.el (gnus-cite-delete-overlays): Protect against diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index c021c3a..68304b3 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1257,6 +1257,9 @@ article numbers will be returned." ;; 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) @@ -2201,15 +2204,15 @@ FORCE is equivalent to setting gnus-agent-expire-days to zero(0)." (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. @@ -2260,7 +2263,7 @@ FORCE is equivalent to setting gnus-agent-expire-days to zero(0)." ) (when marker - (push "NOV entry removed" article) + (push "NOV entry removed" actions) (goto-char marker) (gnus-delete-line)) @@ -2272,6 +2275,8 @@ FORCE is equivalent to setting gnus-agent-expire-days to zero(0)." (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. @@ -2412,9 +2417,10 @@ FORCE is equivalent to setting gnus-agent-expire-days to zero(0)." ;; 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 diff --git a/lisp/gnus-int.el b/lisp/gnus-int.el index 74d68d0..129a6e3 100644 --- a/lisp/gnus-int.el +++ b/lisp/gnus-int.el @@ -508,10 +508,10 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (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) @@ -519,7 +519,7 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (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)) -- 1.7.10.4