Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!shelby!csli!cwitty From: cwitty@csli.Stanford.EDU (Carl Witty) Newsgroups: comp.emacs Subject: Re: Gnews loses track of articles less than 1000 Message-ID: <8344@csli.STANFORD.EDU> Date: 1 Apr 89 00:16:39 GMT References: <8903281229.AA26172@wheat-chex.ai.mit.edu> Sender: cwitty@csli.Stanford.EDU (Carl Witty) Reply-To: cwitty@csli.Stanford.EDU (Carl Witty) Organization: Center for the Study of Language and Information, Stanford U. Lines: 72 In-reply-to: gnulists@WHEATIES.AI.MIT.EDU In article <8903281229.AA26172@wheat-chex.ai.mit.edu>, gnulists@WHEATIES writes: > > Has anybody run into a problem with Gnews when the > article numbers go over 1000? It seems to lose track of > all the articles less than 1000 whether you've read them > or not. On our system, the number of articles in > comp.emacs just went over 1000 and here's what I found: ... > Incidently, this may have happened when we hit 100 > and I just didn't notice. And if that theory's true, > the bug won't surface again for comp.emacs until we > hit 10000...? That's right. > Could it be some problem that exists only for Gnews > running in spool (non-nntp) mode? That's right. >Eric Boutilier UUCP: uunet!fed!m1edb00 >(202) 452-2734 INTERNET: m1edb00@fed.frb.gov I just tracked down this bug, and here's what I found: The spool code gets the list of articles from "ls", which sorts by lexicographic order rather than numerically. At one point in the code, the variable gnews-spool-group-list holds a list, which might look like (1000 1001 1002 998 999). It then calls (sort gnews-spool-group-list '<), which destructively sorts the list and returns the sorted list. However, it does not set gnews-spool-group-list to this sorted list (given the way lisp works, it can't.) Thus gnews-spool-group-list becomes (1000 1001 1002). To fix this, find gnews-spool-exec-group in Spool.el, and change the line (sort gnews-spool-group-list '<) to (setq gnews-spool-group-list (sort gnews-spool-group-list '<)). I've included the modified version of gnews-spool-exec-group after my signature. Carl Witty cwitty@csli.Stanford.EDU (defun gnews-spool-exec-group (gp) "Fake an NNTP group command." (let ((dir (gnews-spool-dir gp)) c f l) (if (and (file-readable-p dir) (car (file-attributes dir))) (gnews-string-as-buffer "" nil (setq gnews-server-article nil) (setq gnews-server-group gp) (call-process "ls" nil t nil dir) (goto-char 1) (insert "(setq gnews-spool-group-list (gnews-spool-preen '(") (goto-char (point-max)) (insert ")))") (eval-current-buffer) (if (null gnews-spool-group-list) (gnews-spool-info "211 0 0 0" gp) ; nothing there (setq gnews-spool-group-list (sort gnews-spool-group-list '<)) ;; added setq to line above, 3/31/89, Carl Witty (setq gnews-spool-group-tsil (reverse gnews-spool-group-list)) (setq c (length gnews-spool-group-list)) (setq f (car gnews-spool-group-list)) (setq l (car gnews-spool-group-tsil)) (gnews-spool-info "211" c f l gp) t)) (gnews-spool-info "411 Invalid group name.") nil))) -- Carl Witty cwitty@csli.stanford.edu