Gnus development mailing list
 help / color / mirror / Atom feed
* emacs.gnus
@ 2003-06-08 13:04 Hanak David
  2003-06-08 19:12 ` emacs.gnus Kai Großjohann
  0 siblings, 1 reply; 10+ messages in thread
From: Hanak David @ 2003-06-08 13:04 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 3821 bytes --]

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
+ <method>-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.")
+ 
  \f
  
  (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

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-06-10 16:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-08 13:04 emacs.gnus Hanak David
2003-06-08 19:12 ` emacs.gnus Kai Großjohann
2003-06-08 21:04   ` emacs.gnus Hanak David
2003-06-09  9:16     ` emacs.gnus Kai Großjohann
2003-06-09 12:24       ` emacs.gnus Hanak David
2003-06-09 13:34         ` emacs.gnus Kai Großjohann
2003-06-09 15:00           ` emacs.gnus Hanak David
2003-06-09 17:34             ` emacs.gnus Kai Großjohann
2003-06-10 13:33               ` emacs.gnus Hanak David
2003-06-10 16:58                 ` emacs.gnus Kai Großjohann

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).