Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Subject: Re: "seen" marks create adjacent lists
Date: Sat, 29 Dec 2001 15:27:22 +0100	[thread overview]
Message-ID: <ilu1yheksol.fsf@extundo.com> (raw)
In-Reply-To: <m3k7v6u458.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Sat, 29 Dec 2001 03:54:59 +0100")

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Karl Kleinpaste <karl@charcoal.com> 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.




      reply	other threads:[~2001-12-29 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-25 14:29 Karl Kleinpaste
2001-12-29  2:54 ` Lars Magne Ingebrigtsen
2001-12-29 14:27   ` Simon Josefsson [this message]

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=ilu1yheksol.fsf@extundo.com \
    --to=jas@extundo.com \
    /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).