From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/41082 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: "seen" marks create adjacent lists Date: Sat, 29 Dec 2001 15:27:22 +0100 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 1035176536 4290 80.91.224.250 (21 Oct 2002 05:02:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:02:16 +0000 (UTC) Return-Path: Original-Received: (qmail 22123 invoked from network); 29 Dec 2001 14:31:12 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 29 Dec 2001 14:31:12 -0000 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 16KKV0-0001oi-00; Sat, 29 Dec 2001 08:30:10 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 29 Dec 2001 08:29:56 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id IAA26675 for ; Sat, 29 Dec 2001 08:29:44 -0600 (CST) Original-Received: (qmail 22101 invoked by alias); 29 Dec 2001 14:29:47 -0000 Original-Received: (qmail 22096 invoked from network); 29 Dec 2001 14:29:46 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 29 Dec 2001 14:29:46 -0000 Original-Received: from localhost.localdomain ([195.42.214.241]) (authenticated bits=0) by yxa.extundo.com (8.12.1/8.12.1) with ESMTP id fBTEThSr018942 for ; Sat, 29 Dec 2001 15:29:46 +0100 Original-To: ding@gnus.org In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sat, 29 Dec 2001 03:54:59 +0100") Mail-Copies-To: nobody Original-Lines: 73 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:41082 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:41082 Lars Magne Ingebrigtsen writes: > Karl Kleinpaste writes: > >> I've noticed that "seen" marks have a pronounced tendency to create >> pointlessly adjacent number lists, rather than subsuming new items >> into existing lists. Here's an example: > > [...] > >> - (105429 . 106775))) >> + (105429 . 106776) >> + 106777)) >> (nntp "news")) >> ("nntp+news:comp.protocols.dns.ops" 3 >> ((1 . 93004)) >> >> Before this particular run of Gnus, I'd seen up through 106775. When >> I ran Gnus, there were 2 articles there, which I read (or at least >> used `d' on), and Gnus correctly identifies that I've seen up through >> 106777 now. > > This must be a bug in the range handling functions... Hm... > > This is the code that does the updating: > > (when (eq (cdr type) 'seen) > (setq list > (if list > (gnus-range-add (gnus-uncompress-sequence list) > gnus-newsgroup-unseen) > (gnus-compress-sequence gnus-newsgroup-articles)))) > > First of all -- we see that the code is wonky. It uncompresses the > range of seen articles, which will give us a rather huge list of > articles after a while. > > However: > > (gnus-range-add (gnus-uncompress-sequence '((105429 . 106775))) > '(106776 106777)) > => > ((105429 . 106777)) > > It does seem to give us the right results. Can you reproduce this > error? FWIW, the code didn't used to look that way. It used to look like: (if list (gnus-add-to-range list gnus-newsgroup-unseen) (gnus-compress-sequence gnus-newsgroup-articles)))) which breaks in this case: (gnus-add-to-range '(1 2 3 4) '(5 6 7)) => ((1 . 2) (3 . 4) (5 . 7)) which is what accidently happened, since `push' was used to populate `gnus-newsgroup-unseen'. I think I fixed this on 200-12-27. > Removing the uncompress thing gives us the same answer. > > (gnus-range-add '((105429 . 106775)) > '(106776 106777)) > => > ((105429 . 106777)) > > (I've now done this in the source as well.) People that have been running with the old code might have bad ranges which the `gnus-uncompress-range' would fix though. Bud it is probably better not to cater for that.