From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/80457 Path: news.gmane.org!not-for-mail From: pmlists@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=) Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Make it possible to re-scan exactly one level. Date: Mon, 31 Oct 2011 23:18:02 +0100 Message-ID: <8739e824bp.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1320099618 18341 80.91.229.12 (31 Oct 2011 22:20:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Oct 2011 22:20:18 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M28743@lists.math.uh.edu Mon Oct 31 23:20:13 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RL0DC-0000EB-Sa for ding-account@gmane.org; Mon, 31 Oct 2011 23:20:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1RL0DB-0001Cf-PJ; Mon, 31 Oct 2011 17:20:09 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1RL0DA-0001CU-JC for ding@lists.math.uh.edu; Mon, 31 Oct 2011 17:20:08 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RL0D9-0007ol-K0 for ding@lists.math.uh.edu; Mon, 31 Oct 2011 17:20:08 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1RL0D8-0003xf-85 for ding@gnus.org; Mon, 31 Oct 2011 23:20:06 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RL0D6-0000DH-U6 for ding@gnus.org; Mon, 31 Oct 2011 23:20:04 +0100 Original-Received: from arennes-359-1-206-2.w2-2.abo.wanadoo.fr ([2.2.69.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Oct 2011 23:20:04 +0100 Original-Received: from pmlists by arennes-359-1-206-2.w2-2.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Oct 2011 23:20:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 76 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: arennes-359-1-206-2.w2-2.abo.wanadoo.fr User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:RDmUgZgpxenJjWANUywLkAmrJ1c= X-Spam-Score: -6.1 (------) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:80457 Archived-At: * 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. --- lisp/ChangeLog | 6 ++++++ lisp/gnus-group.el | 8 +++++--- lisp/gnus-start.el | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea8d600..38783aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-10-31 Peter Münster (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-10-31 Teodor Zlatanov * nnregistry.el: Remove unnecessary `gnus-registry-enabled' defvar. diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 4c527ca..64e8047 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -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) diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 7c63d5e..0ddab6f 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -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)) -- 1.7.3.4