* [PATCH] Make it possible to re-scan exactly one level.
@ 2011-10-31 22:18 Peter Münster
2011-11-03 22:33 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Peter Münster @ 2011-10-31 22:18 UTC (permalink / raw)
To: ding
* 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 <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-10-31 Teodor Zlatanov <tzz@lifelogs.com>
* 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Make it possible to re-scan exactly one level.
2011-10-31 22:18 [PATCH] Make it possible to re-scan exactly one level Peter Münster
@ 2011-11-03 22:33 ` Lars Magne Ingebrigtsen
2011-11-03 23:28 ` Katsumi Yamaoka
0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-11-03 22:33 UTC (permalink / raw)
To: Peter Münster; +Cc: ding
pmlists@free.fr (Peter Münster) writes:
> + * 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.
Thanks; applied.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Make it possible to re-scan exactly one level.
2011-11-03 22:33 ` Lars Magne Ingebrigtsen
@ 2011-11-03 23:28 ` Katsumi Yamaoka
0 siblings, 0 replies; 3+ messages in thread
From: Katsumi Yamaoka @ 2011-11-03 23:28 UTC (permalink / raw)
To: ding
Lars Magne Ingebrigtsen wrote:
> pmlists@free.fr (Peter Münster) writes:
>> + * 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.
> Thanks; applied.
Thanks. That's a very good feature for all Gnus users, I think,
but is a new feature, so I'll delay merging it to the Emacs trunk
till the feature freeze is lifted.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-03 23:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-31 22:18 [PATCH] Make it possible to re-scan exactly one level Peter Münster
2011-11-03 22:33 ` Lars Magne Ingebrigtsen
2011-11-03 23:28 ` Katsumi Yamaoka
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).