(gnus-group-get-new-news): New parameter `one-level' for scanning exactly one level
authorPeter Münster <pmrb@free.fr>
Thu, 3 Nov 2011 22:34:42 +0000 (23:34 +0100)
committerLars Magne Ingebrigtsen <larsi@stories.gnus.org>
Thu, 3 Nov 2011 22:34:42 +0000 (23:34 +0100)
(gnus-get-unread-articles): Ditto.

lisp/ChangeLog
lisp/gnus-group.el
lisp/gnus-start.el

index 7bf1362..e5c2419 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-31  Peter Münster  <pmrb@free.fr>  (tiny change)
+
+       * gnus-group.el (gnus-group-get-new-news): New parameter `one-level'
+       for scanning exactly one level.
+       * gnus-start.el (gnus-get-unread-articles): Ditto.
+
 2011-11-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-sum.el (gnus-articles-to-read): Change wording in prompt to be
index 4c527ca..64e8047 100644 (file)
@@ -4009,11 +4009,13 @@ entail asking the server for the groups."
        (gnus-activate-foreign-newsgroups level))
     (gnus-group-get-new-news)))
 
-(defun gnus-group-get-new-news (&optional arg)
+(defun gnus-group-get-new-news (&optional arg one-level)
   "Get newly arrived articles.
 If ARG is a number, it specifies which levels you are interested in
 re-scanning.  If ARG is non-nil and not a number, this will force
-\"hard\" re-reading of the active files from all servers."
+\"hard\" re-reading of the active files from all servers.
+If ONE-LEVEL is not nil, then re-scan only the specified level,
+otherwise all levels below ARG will be scanned too."
   (interactive "P")
   (require 'nnmail)
   (let ((gnus-inhibit-demon t)
@@ -4027,7 +4029,7 @@ re-scanning.  If ARG is non-nil and not a number, this will force
     (unless gnus-slave
       (gnus-master-read-slave-newsrc))
 
-    (gnus-get-unread-articles arg)
+    (gnus-get-unread-articles arg nil one-level)
 
     ;; If the user wants it, we scan for new groups.
     (when (eq gnus-check-new-newsgroups 'always)
index 7c63d5e..0ddab6f 100644 (file)
@@ -1606,7 +1606,7 @@ If SCAN, request a scan of that group as well."
 
 ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb'
 ;; and compute how many unread articles there are in each group.
-(defun gnus-get-unread-articles (&optional level dont-connect)
+(defun gnus-get-unread-articles (&optional level dont-connect one-level)
   (setq gnus-server-method-cache nil)
   (require 'gnus-agent)
   (let* ((newsrc (cdr gnus-newsrc-alist))
@@ -1663,7 +1663,7 @@ If SCAN, request a scan of that group as well."
        (push (setq method-group-list (list method method-type nil nil))
              type-cache))
       ;; Only add groups that need updating.
-      (if (<= (gnus-info-level info)
+      (if (funcall (if one-level #'= #'<=) (gnus-info-level info)
              (if (eq (cadr method-group-list) 'foreign)
                  foreign-level
                alevel))