From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/23193 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: agent eating article marks Date: 12 Jun 1999 20:51:24 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035160971 702 80.91.224.250 (21 Oct 2002 00:42:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:42:51 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA00664 for ; Sat, 12 Jun 1999 14:55:37 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id NAB12134; Sat, 12 Jun 1999 13:51:54 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 12 Jun 1999 13:52:39 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA14662 for ; Sat, 12 Jun 1999 13:52:24 -0500 (CDT) Original-Received: from xiphias.pdc.kth.se (xiphias.pdc.kth.se [130.237.221.226]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA00613 for ; Sat, 12 Jun 1999 14:51:28 -0400 (EDT) Original-Received: (from jas@localhost) by xiphias.pdc.kth.se (8.8.5/8.8.5) id UAA13461; Sat, 12 Jun 1999 20:51:24 +0200 (METDST) Original-To: ding@gnus.org In-Reply-To: Lars Magne Ingebrigtsen's message of "12 Jun 1999 06:07:41 +0200" Original-Lines: 74 User-Agent: Gnus/5.070085 (Pterodactyl Gnus v0.85) Emacs/20.3.10 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:23193 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:23193 Lars Magne Ingebrigtsen writes: > > * (gnus-agentize), register some nntp server with the agent > > * Enter a nntp group with unread articles, read and tick some > > articles, quit the group > > * Fetch articles from the group to the agent with `J u' > > * Go unplugged, `J J' > > * Enter the group (the ticked articles aren't shown of course, since > > they are read and not fetched by the agent), > > I think the Agent is supposed to fetch ticker articles. It doesn't do > this? Nope. It only fetches headers for unread articles (`gnus-agent-fetch-headers' calls `gnus-list-of-unread-articles' to find out what article headers it should fetch). This is my fix, it should be possible to do it simpler and cleaner but I don't know enough inner details to work something out. The Agent will now fetch headers for unread articles and articles with marks (instead of just unread articles), and it will also make them eligible for downloading. The fix to `gnus-agent-get-undownloaded-list' was required to make sure it marked a ticked but read articles as undownloaded (instead of saying that it didn't exist) if that was the case. 1999-06-12 Simon Josefsson (gnus-agent-get-undownloaded-list): Operate on all articles, not only unread ones. (gnus-agent-fetch-headers): Fetch headers from unread and marked articles, not only unread ones. --- gnus-agent.el.DIST Sat Jun 12 17:49:13 1999 +++ gnus-agent.el Sat Jun 12 20:39:43 1999 @@ -515,7 +515,8 @@ (gnus-agent-method-p gnus-command-method)) (gnus-agent-load-alist gnus-newsgroup-name) ;; First mark all undownloaded articles as undownloaded. - (let ((articles gnus-newsgroup-unreads) + (let ((articles (gnus-uncompress-sequence + (gnus-active gnus-newsgroup-name))) article) (while (setq article (pop articles)) (unless (or (cdr (assq article gnus-agent-article-alist)) @@ -787,15 +788,21 @@ (pop gnus-agent-group-alist)))) (defun gnus-agent-fetch-headers (group &optional force) - (let ((articles (if (gnus-agent-load-alist group) - (gnus-sorted-intersection - (gnus-list-of-unread-articles group) - (gnus-uncompress-range - (cons (1+ (caar (last gnus-agent-article-alist))) - (cdr (gnus-active group))))) - (gnus-list-of-unread-articles group))) + (let ((articles (gnus-list-of-unread-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 + (dolist (arts (gnus-info-marks (gnus-get-info group))) + (setq articles (union (gnus-uncompress-sequence (cdr arts)) + articles))) + (setq articles (sort articles '<)) + ;; remove known articles + (when (gnus-agent-load-alist group) + (setq articles (gnus-sorted-intersection + articles + (gnus-uncompress-range + (cons (1+ (caar (last gnus-agent-article-alist))) + (cdr (gnus-active group))))))) ;; Fetch them. (gnus-make-directory (nnheader-translate-file-chars (file-name-directory file)))