X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;ds=inline;f=lisp%2Fnnagent.el;h=7234d402a98f0c25334e3be13d4c8cd0eeedb1ab;hb=6571a7de663107823288ad6df4a9435ccc19f2dc;hp=5bdc1e6a5a18f9475dd9b515b32f6a8e3e7e747b;hpb=3aea1902b52544b9400962e997708c2daa29e460;p=gnus diff --git a/lisp/nnagent.el b/lisp/nnagent.el index 5bdc1e6a5..7234d402a 100644 --- a/lisp/nnagent.el +++ b/lisp/nnagent.el @@ -1,7 +1,7 @@ ;;; nnagent.el --- offline backend for Gnus -;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 -;; Free Software Foundation, Inc. +;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +;; 2005, 2006 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news, mail @@ -20,8 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -103,7 +103,7 @@ (defun nnagent-request-type (group article) (unless (stringp article) - (let ((gnus-plugged t)) + (let ((gnus-agent nil)) (if (not (gnus-check-backend-function 'request-type (car gnus-command-method))) 'unknown @@ -122,27 +122,48 @@ (deffoo nnagent-request-set-mark (group action server) (with-temp-buffer - (insert (format "(%s-request-set-mark \"%s\" '%s \"%s\")\n" - (nth 0 gnus-command-method) group action - (or server (nth 1 gnus-command-method)))) - (append-to-file (point-min) (point-max) (gnus-agent-lib-file "flags"))) + (insert "(gnus-agent-synchronize-group-flags \"" + group + "\" '") + (gnus-pp action) + (insert " \"" + (gnus-method-to-server gnus-command-method) + "\"") + (insert ")\n") + (write-region (point-min) (point-max) (gnus-agent-lib-file "flags") + t 'silent)) nil) (deffoo nnagent-retrieve-headers (articles &optional group server fetch-old) (let ((file (gnus-agent-article-name ".overview" group)) - arts n) + arts n first) (save-excursion (gnus-agent-load-alist group) - (setq arts (gnus-set-difference articles - (mapcar 'car gnus-agent-article-alist))) + (setq arts (gnus-sorted-difference + articles (mapcar 'car gnus-agent-article-alist))) + ;; Assume that articles with smaller numbers than the first one + ;; Agent knows are gone. + (setq first (caar gnus-agent-article-alist)) + (when first + (while (and arts (< (car arts) first)) + (pop arts))) (set-buffer nntp-server-buffer) (erase-buffer) - (nnheader-insert-file-contents file) + (nnheader-insert-nov-file file (car articles)) (goto-char (point-min)) - ;; This loop is just for the `condition-case' -- if reading bugs - ;; out on a line, it'll still continue on to the next line. So - ;; this look is normally just executed once. - + (gnus-parse-without-error + (while (and arts (not (eobp))) + (setq n (read (current-buffer))) + (when (> n (car arts)) + (beginning-of-line)) + (while (and arts (> n (car arts))) + (insert (format + "%d\t[Undownloaded article %d]\tGnus Agent\t\t\t\n" + (car arts) (car arts))) + (pop arts)) + (when (and arts (= n (car arts))) + (pop arts)) + (forward-line 1))) (while arts (insert (format "%d\t[Undownloaded article %d]\tGnus Agent\t\t\t\n" @@ -158,6 +179,9 @@ t) 'nov))) +(deffoo nnagent-request-expire-articles (articles group &optional server force) + articles) + (deffoo nnagent-request-group (group &optional server dont-check) (nnoo-parent-function 'nnagent 'nnml-request-group (list group (nnagent-server server) dont-check))) @@ -182,10 +206,6 @@ (nnoo-parent-function 'nnagent 'nnml-request-delete-group (list group force (nnagent-server server)))) -(deffoo nnagent-request-expire-articles (articles group &optional server force) - (nnoo-parent-function 'nnagent 'nnml-request-expire-articles - (list articles group (nnagent-server server) force))) - (deffoo nnagent-request-list (&optional server) (nnoo-parent-function 'nnagent 'nnml-request-list (list (nnagent-server server)))) @@ -195,10 +215,10 @@ (list (nnagent-server server)))) (deffoo nnagent-request-move-article - (article group server accept-form &optional last) + (article group server accept-form &optional last move-is-internal) (nnoo-parent-function 'nnagent 'nnml-request-move-article (list article group (nnagent-server server) - accept-form last))) + accept-form last move-is-internal))) (deffoo nnagent-request-rename-group (group new-name &optional server) (nnoo-parent-function 'nnagent 'nnml-request-rename-group @@ -233,4 +253,5 @@ (provide 'nnagent) +;;; arch-tag: af710b77-f816-4969-af31-6fd94fb42245 ;;; nnagent.el ends here