From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46966 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: Re: Nnimap number of unread articles estimate now correct Date: Thu, 03 Oct 2002 18:24:01 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1033683879 7231 127.0.0.1 (3 Oct 2002 22:24:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 3 Oct 2002 22:24:39 +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 17xEOc-0001sT-00 for ; Fri, 04 Oct 2002 00:24:38 +0200 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 17xEOK-0001jA-00; Thu, 03 Oct 2002 17:24:20 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 03 Oct 2002 17:25:02 -0500 (CDT) 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 RAA03909 for ; Thu, 3 Oct 2002 17:24:51 -0500 (CDT) Original-Received: (qmail 1644 invoked by alias); 3 Oct 2002 22:24:04 -0000 Original-Received: (qmail 1639 invoked from network); 3 Oct 2002 22:24:03 -0000 Original-Received: from multivac.student.cwru.edu (HELO multivac.cwru.edu) (@129.22.96.25) by gnus.org with SMTP; 3 Oct 2002 22:24:03 -0000 Original-Received: (qmail 25717 invoked by uid 500); 3 Oct 2002 22:24:25 -0000 Original-To: ding@gnus.org In-Reply-To: (Simon Josefsson's message of "Fri, 27 Sep 2002 00:32:25 +0200") Mail-Copies-To: nobody Mail-Followup-To: ding@gnus.org Original-Lines: 41 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46966 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46966 Simon Josefsson wrote: > I started implementing a proper fix too, and I chosed to extend the > symbol values in `gnus-active-hashtb' to hold unread count as well as > max/min values, but it seemed like alot of changes and if the hack > above works, it might cause less trouble to use it. Somewhat related to this, I was debugging gnus-get-unread-articles-in-group because of nnmaildir's new wrong article counts, and I think I found a couple of bugs. This part doesn't handle the case where we have a plain number inside a range list: ;; Adjust the first element to be the same as the lower limit. (when (and (not (atom (car range))) (< (cdar range) (car active))) (setcdr (car range) (1- (car active)))) (I.e., this should be if instead of when, and it should have an else branch.) This part counts the number of articles in range, and then calculates the number of unread articles by subtracting the count from the maximum article number: ;; Compute the number of unread articles. (while range (setq num (+ num (- (1+ (or (and (atom (car range)) (car range)) (cdar range))) (or (and (atom (car range)) (car range)) (caar range))))) (setq range (cdr range))) (setq num (max 0 (- (cdr active) num))))) But it should subtract the read count from (1+ (- maximum minimum)) instead, shouldn't it? If someone can confirm my understanding, I'll fix these bugs. It seems this code could also be made much more readable (such as by using gnus-range-length instead of the above loop), but I didn't want to change things out from under you while you're changing the data structures, Simon. Let me know if it's safe to work on this now, or if I should wait till you're done. paul