diff lisp/gnus/gnus-sum.el @ 79022:65ad63ddd4f6

Merge from gnus--rel--5.10 Revision: emacs@sv.gnu.org/emacs--rel--22--patch-115
author Miles Bader <miles@gnu.org>
date Tue, 09 Oct 2007 08:55:58 +0000
parents 2d4fbb82deec
children f6c37512dd9e bdb3fe0ba9fa
line wrap: on
line diff
--- a/lisp/gnus/gnus-sum.el	Tue Oct 09 08:39:33 2007 +0000
+++ b/lisp/gnus/gnus-sum.el	Tue Oct 09 08:55:58 2007 +0000
@@ -1029,6 +1029,17 @@
   :type '(repeat symbol)
   :group 'gnus-charset)
 
+(defcustom gnus-newsgroup-maximum-articles nil
+  "The maximum number of articles a newsgroup.
+If this is a number, old articles in a newsgroup exceeding this number
+are silently ignored.  If it is nil, no article is ignored.  Note that
+setting this variable to a number might prevent you from reading very
+old articles."
+  :group 'gnus-group-select
+  :version "22.2"
+  :type '(choice (const :tag "No limit" nil)
+		 integer))
+
 (gnus-define-group-parameter
  ignored-charsets
  :type list
@@ -5472,11 +5483,13 @@
 	      ;; articles in the group, or (if that's nil), the
 	      ;; articles in the cache.
 	      (or
-	       (if gnus-maximum-newsgroup
+	       (if gnus-newsgroup-maximum-articles
 		   (let ((active (gnus-active group)))
 		     (gnus-uncompress-range
 		      (cons (max (car active)
-				 (- (cdr active) gnus-maximum-newsgroup -1))
+				 (- (cdr active)
+				    gnus-newsgroup-maximum-articles
+				    -1))
 			    (cdr active))))
 		 (gnus-uncompress-range (gnus-active group)))
 	       (gnus-cache-articles-in-group group))
@@ -6540,8 +6553,9 @@
   (let* ((read (gnus-info-read (gnus-get-info group)))
 	 (active (or (gnus-active group) (gnus-activate-group group)))
 	 (last (cdr active))
-	 (bottom (if gnus-maximum-newsgroup
-		     (max (car active) (- last gnus-maximum-newsgroup -1))
+	 (bottom (if gnus-newsgroup-maximum-articles
+		     (max (car active)
+			  (- last gnus-newsgroup-maximum-articles -1))
 		   (car active)))
 	 first nlast unread)
     ;; If none are read, then all are unread.
@@ -6585,9 +6599,11 @@
 	  (gnus-list-range-difference
 	   (gnus-sorted-complement
 	    (gnus-uncompress-range
-	     (if gnus-maximum-newsgroup
+	     (if gnus-newsgroup-maximum-articles
 		 (cons (max (car active)
-			    (- (cdr active) gnus-maximum-newsgroup -1))
+			    (- (cdr active)
+			       gnus-newsgroup-maximum-articles
+			       -1))
 		       (cdr active))
 	       active))
 	    (gnus-list-of-unread-articles group))
@@ -6601,8 +6617,9 @@
   (let* ((read (gnus-info-read (gnus-get-info group)))
 	 (active (or (gnus-active group) (gnus-activate-group group)))
 	 (last (cdr active))
-	 (bottom (if gnus-maximum-newsgroup
-		     (max (car active) (- last gnus-maximum-newsgroup -1))
+	 (bottom (if gnus-newsgroup-maximum-articles
+		     (max (car active)
+			  (- last gnus-newsgroup-maximum-articles -1))
 		   (car active)))
 	 first nlast unread)
     ;; If none are read, then all are unread.