Greetings, I find it annoying that Gnus cannot determine the exact article count for nnml groups. Since I often move messages from one group to another, or expire articles, the active range is full of holes. Therefore, when I ask Gnus for, say, 50 articles, it might happen that I only get 5. And the estimate for the number of artciles can also become very wild. I've hacked this for myself quite a while ago, but very recently I've joined the Gnus newsgroups, and decided to send a patch that would solve the problem for others, too. The patches are up to date, they are based on the CVS version. Please feel free to modify them. I modified two files, gnus-sum.el and nnml.el. The patches follow. David ---------- cut here ---------- *** /usr/share/emacs/site-lisp/gnus/lisp/gnus-sum.el 2003-06-07 19:40:22.000000000 +0200 --- ./gnus-sum.el 2003-06-08 14:35:43.000000000 +0200 *************** *** 5226,5231 **** --- 5226,5241 ---- (memq article gnus-newsgroup-recent)) (t t)))) + (defun gnus-group-article-list (group) + "Return a list of all article numbers in GROUP. If + -group-article-list exists and returns non-nil, returns that value, + otherwise returns the range stored in the active info." + (let* ((method (symbol-name (car (gnus-find-method-for-group group)))) + (listf (intern (concat method "-group-article-list")))) + (or (and (functionp listf) + (funcall listf group)) + (gnus-uncompress-range (gnus-active group))))) + (defun gnus-articles-to-read (group &optional read-all) "Find out what articles the user wants to read." (let* ((display (gnus-group-find-parameter group 'display)) *************** *** 5242,5248 **** ;; articles in the group, or (if that's nil), the ;; articles in the cache. (or ! (gnus-uncompress-range (gnus-active group)) (gnus-cache-articles-in-group group)) ;; Select only the "normal" subset of articles. (gnus-sorted-nunion --- 5252,5258 ---- ;; articles in the group, or (if that's nil), the ;; articles in the cache. (or ! (gnus-group-article-list group) (gnus-cache-articles-in-group group)) ;; Select only the "normal" subset of articles. (gnus-sorted-nunion *** /usr/share/emacs/site-lisp/gnus/lisp/nnml.el 2003-05-01 16:23:15.000000000 +0200 --- ./nnml.el 2003-06-08 14:32:27.000000000 +0200 *************** *** 84,89 **** --- 84,96 ---- (defvoo nnml-use-compressed-files nil "If non-nil, allow using compressed message files.") + (defvoo nnml-ignore-active-file nil + "If non-nil or matches the group name as a regexp, the active file is + ignored. This causes nnml to do some extra work in order to determine the + true active ranges of a group. Note that the active file is still saved, + but its values are not used. This costs some extra time when scanning a + group when opening it.") + (defconst nnml-version "nnml 1.0" *************** *** 1007,1012 **** --- 1014,1031 ---- (nnml-save-marks group server) (nnheader-message 7 "Bootstrapping marks for %s...done" group))))) + (deffoo nnml-group-article-list (group) + "Return a list of all article numbers in group if + `nnml-ignore-active-file' is t or matches the group name as a regexp, + otherwise return nil. Called from `gnus-group-article-list'." + (if (or (eq nnml-ignore-active-file t) + (and (stringp nnml-ignore-active-file) + (string-match nnml-ignore-active-file group))) + (sort (nnheader-directory-articles + (nnheader-group-pathname (gnus-group-real-name group) + nnml-directory)) + '<))) + (provide 'nnml) ;;; nnml.el ends here