Gnus development mailing list
 help / color / mirror / Atom feed
From: Paul Stodghill <stodghil@cs.cornell.edu>
Subject: Evil hack to get agent to download ALL (even read) articles
Date: 22 Aug 2001 15:08:19 -0400	[thread overview]
Message-ID: <yz1y9obvroc.fsf@milhouse.cs.cornell.edu> (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))



                 reply	other threads:[~2001-08-22 19:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yz1y9obvroc.fsf@milhouse.cs.cornell.edu \
    --to=stodghil@cs.cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).