Gnus development mailing list
 help / color / mirror / Atom feed
* Evil hack to get agent to download ALL (even read) articles
@ 2001-08-22 19:08 Paul Stodghill
  0 siblings, 0 replies; only message in thread
From: Paul Stodghill @ 2001-08-22 19:08 UTC (permalink / raw)


IMPORTANT DISCLAIMER: I'm not at all familiar with the internals of
Gnus, so this patch may do very bad things. Also, do not attempt this unless
your network connection is sufficiently fast to download ALL of the
articles in your agentized groups.

Motivation - MS Outlook gives you the ability to mark certain folders as
available for offline access. I use this feature to keep a complete copy
of my IMAP folders on my laptop. Gnus-agent provides a similar ability,
but, (a) it only downloads articles that are explicitly marked or are
unread, and (b) it does not consider articles whose number is less than
the greatest article downloaded (ie, it doesn't fill in holes in the
article sequence).

Below is how I managed to twist gnus-agent so it would download all
articles, even articles that have been read and have not been marked
for downloading.

Caveats:
- I don't know how this interacts with the predicates in the
  gnus-agent (mine are unconditionally set to true) or with article
  expiration.
- This is all with respect to Oort 0.3.

Here we go:

1) Apply the patch at bottom of the message. Re-byte-compile and reload
   gnus-agent.el

2) Exit gnus.

3) Remove the gnus-directory/News/agent/{nntp,nnimap,nn...}. 
   BE CAREFUL! Do not remove gnus-directory/News/agent/lib.

4) Start gnus.

5) Hit "J s".

6) Go do something else for a hour or so.

That's it.

I hope that someone else finds this useful, and I hope that a more ...
err ... robust version of this feature can be incorporated into Oort
0.4.

Thanks.

--- lisp/gnus-agent.el.ORIG	Wed Aug 22 12:05:17 2001
+++ lisp/gnus-agent.el	Wed Aug 22 12:52:29 2001
@@ -951,7 +951,9 @@
       (pop gnus-agent-group-alist))))
 
 (defun gnus-agent-fetch-headers (group &optional force)
-  (let ((articles (gnus-list-of-unread-articles group))
+  (let ((articles 
+	 (gnus-union (gnus-list-of-unread-articles group)
+		     (gnus-list-of-read-articles group)))
 	(gnus-decode-encoded-word-function 'identity)
 	(file (gnus-agent-article-name ".overview" group)))
     ;; Add article with marks to list of article headers we want to fetch.
@@ -961,11 +963,9 @@
     (setq articles (sort articles '<))
     ;; Remove known articles.
     (when (gnus-agent-load-alist group)
-      (setq articles (gnus-sorted-intersection
+      (setq articles (gnus-sorted-complement
 		      articles
-		      (gnus-uncompress-range
-		       (cons (1+ (caar (last gnus-agent-article-alist)))
-			     (cdr (gnus-active group)))))))
+		      (mapcar #'car gnus-agent-article-alist))))
     ;; Fetch them.
     (gnus-make-directory (nnheader-translate-file-chars
 			  (file-name-directory file) t))



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-22 19:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-22 19:08 Evil hack to get agent to download ALL (even read) articles Paul Stodghill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).