From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50260 Path: main.gmane.org!not-for-mail From: Kevin Greiner Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-agent showing wrong data: some investigations Date: Sat, 22 Feb 2003 11:54:39 -0600 Sender: owner-ding@hpc.uh.edu Message-ID: References: <84el60bhuv.fsf@lucy.is.informatik.uni-duisburg.de> <84k7fspi29.fsf@lucy.is.informatik.uni-duisburg.de> <84heawphyn.fsf@lucy.is.informatik.uni-duisburg.de> <84y948mi7f.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1045936575 30793 80.91.224.249 (22 Feb 2003 17:56:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 22 Feb 2003 17:56:15 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18mdsh-00080I-00 for ; Sat, 22 Feb 2003 18:56:11 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18mdrb-0000DW-00; Sat, 22 Feb 2003 11:55:03 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 22 Feb 2003 11:56:02 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id LAA29589 for ; Sat, 22 Feb 2003 11:55:46 -0600 (CST) Original-Received: (qmail 2296 invoked by alias); 22 Feb 2003 17:54:43 -0000 Original-Received: (qmail 2291 invoked from network); 22 Feb 2003 17:54:43 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by 66.230.238.6 with SMTP; 22 Feb 2003 17:54:43 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 18me5h-0004RL-00 for ; Sat, 22 Feb 2003 19:09:37 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 67 Original-NNTP-Posting-Host: 216.12.206.252 Original-X-Trace: quimby.gnus.org 1045937377 16934 216.12.206.252 (22 Feb 2003 18:09:37 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 22 Feb 2003 18:09:37 GMT User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 Cancel-Lock: sha1:QWPl6bxzI5na+cn+DpM3dklz6cA= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50260 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50260 kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes: > Kevin Greiner writes: > >> I've added a sort to my copy. I should have it checked-in this >> weekend unless you beat me to it. > > I didn't commit it because I think it isn't right. It would be > doctoring the symptoms instead of curing the disease. At least > that's the way I understand it. The problem is that gnus-newsgroup-headers IS SORTED, just not in ascending order. If I remember right, it matches the order of the articles in the summary buffer. > OTOH, I've been looking at where gnus-newsgroup-headers comes from, > and it could indeed come from a non-sorted input. Hm. (For example, > if gnus-select-newsgroup is called with some articles to select, then > that list of articles could be non-sorted.) Hmmm... An uneasy > feeling remains. I'm not sure what to do, or what to think. > Here's what I'm currently trying. (defun gnus-agent-get-undownloaded-list () "Construct list of articles that have not been downloaded." (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) (when (set (make-local-variable 'gnus-newsgroup-agentized) (gnus-agent-method-p gnus-command-method)) (let* ((alist (gnus-agent-load-alist gnus-newsgroup-name)) (headers (sort (mapcar (lambda (h) (mail-header-number h)) gnus-newsgroup-headers) '<)) (undownloaded (list nil)) (tail-undownloaded undownloaded) (unfetched (list nil)) (tail-unfetched unfetched)) (while (and alist headers) (let ((a (caar alist)) (h (car headers))) (cond ((< a h) ;; Ignore IDs in the alist that are not being ;; displayed in the summary. (pop alist)) ((> a h) ;; Headers that are not in the alist should be ;; fictious (see nnagent-retrieve-headers); they ;; imply that this article isn't in the agent. (gnus-agent-append-to-list tail-undownloaded h) (gnus-agent-append-to-list tail-unfetched h) (pop headers)) ((cdar alist) (pop alist) (pop headers) nil ; ignore already downloaded ) (t (pop alist) (pop headers) (gnus-agent-append-to-list tail-undownloaded a))))) (while headers (let ((num (pop headers))) (gnus-agent-append-to-list tail-undownloaded num) (gnus-agent-append-to-list tail-unfetched num))) (setq gnus-newsgroup-undownloaded (cdr undownloaded) gnus-newsgroup-unfetched (cdr unfetched)))))) Kevin