From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/38183 Path: main.gmane.org!not-for-mail From: Paul Stodghill Newsgroups: gmane.emacs.gnus.general Subject: Evil hack to get agent to download ALL (even read) articles Date: 22 Aug 2001 15:08:19 -0400 Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035174089 21035 80.91.224.250 (21 Oct 2002 04:21:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:21:29 +0000 (UTC) Return-Path: Return-Path: Original-Received: (qmail 9333 invoked from network); 22 Aug 2001 19:08:22 -0000 Original-Received: from postoffice.mail.cornell.edu (132.236.56.7) by gnus.org with SMTP; 22 Aug 2001 19:08:22 -0000 Original-Received: from milhouse.cs.cornell.edu.cs.cornell.edu (dhcp99-208.cs.cornell.edu [128.84.99.208]) by postoffice.mail.cornell.edu (8.9.3/8.9.3) with ESMTP id PAA11208 for ; Wed, 22 Aug 2001 15:08:20 -0400 (EDT) Original-To: ding@gnus.org User-Agent: Gnus/5.090003 (Oort Gnus v0.03) XEmacs/21.4 (Academic Rigor) Original-Lines: 74 Xref: main.gmane.org gmane.emacs.gnus.general:38183 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:38183 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))