Auto-subscribe groups from all mail-like backends.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 13 Dec 2010 16:40:57 +0000 (17:40 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 13 Dec 2010 16:40:57 +0000 (17:40 +0100)
lisp/ChangeLog
lisp/gnus-start.el
texi/ChangeLog
texi/gnus.texi

index 0ed1413..35fdd41 100644 (file)
@@ -2,6 +2,8 @@
 
        * gnus-start.el (gnus-auto-subscribed-groups): Add nnimap to the list
        of automatically subscribed groups.
+       (gnus-auto-subscribed-categories): New variable.
+       (gnus-matches-options-n): Use it.
 
 2010-12-13  Andrew Cohen  <cohen@andy.bu.edu>
 
index 2934ccd..fa765e3 100644 (file)
@@ -341,6 +341,15 @@ hierarchy in its entirety."
   :group 'gnus-group-new
   :type 'boolean)
 
+(defcustom gnus-auto-subscribed-categories '(mail post-mail)
+  "*New groups from methods of these categories will be subscribed automatically.
+Note that this variable only deals with new groups.  It has no
+effect whatsoever on old groups.  The default is to automatically
+subscribe all groups from mail-like backends."
+  :version "24.1"
+  :group 'gnus-group-new
+  :type '(repeat symbol))
+
 (defcustom gnus-auto-subscribed-groups
   "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl\\|^nnmaildir\\|^nnimap"
   "*All new groups that match this regexp will be subscribed automatically.
@@ -1158,6 +1167,11 @@ for new groups, and subscribe the new groups as zombies."
    ((and gnus-options-subscribe
         (string-match gnus-options-subscribe group))
     'subscribe)
+   ((let ((do-subscribe nil))
+      (dolist (category gnus-auto-subscribed-categories)
+       (when (gnus-member-of-valid category group)
+         (setq do-subscribe t))))
+    'subscribe)
    ((and gnus-auto-subscribed-groups
         (string-match gnus-auto-subscribed-groups group))
     'subscribe)
index 14b2b25..d5fc6b3 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus.texi (Filtering New Groups): Mention
+       gnus-auto-subscribed-categories.
+
 2010-12-06  Tassilo Horn  <tassilo@member.fsf.org>
 
        * gnus.texi (Server Commands): Point to the rest of the server
index c3517b8..975d780 100644 (file)
@@ -1321,11 +1321,18 @@ but I thought it would be nice to have two of these.  This variable is
 more meant for setting some ground rules, while the other variable is
 used more for user fiddling.  By default this variable makes all new
 groups that come from mail back ends (@code{nnml}, @code{nnbabyl},
-@code{nnfolder}, @code{nnmbox}, @code{nnmh}, and @code{nnmaildir})
-subscribed.  If you don't like that, just set this variable to
-@code{nil}.
-
-New groups that match this regexp are subscribed using
+@code{nnfolder}, @code{nnmbox}, @code{nnmh}, @code{nnimap}, and
+@code{nnmaildir}) subscribed.  If you don't like that, just set this
+variable to @code{nil}.
+
+@vindex gnus-auto-subscribed-categories
+As if that wasn't enough, @code{gnus-auto-subscribed-categories} also
+allows you to specify that new groups should be subcribed based on the
+category their select methods belong to.  The default is @samp{(mail
+post-mail)}, meaning that all new groups from mail-like backends
+should be subscribed automatically.
+
+New groups that match these variables are subscribed using
 @code{gnus-subscribe-options-newsgroup-method}.