changeset 88045:949936fe51a9

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1016
author Miles Bader <miles@gnu.org>
date Mon, 28 Jan 2008 03:51:31 +0000
parents 215c19bb6020
children 2e00b91ccbc1
files doc/misc/ChangeLog doc/misc/gnus.texi lisp/gnus/ChangeLog lisp/gnus/mail-source.el lisp/gnus/nnmail.el
diffstat 5 files changed, 63 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/doc/misc/ChangeLog	Mon Jan 28 03:48:45 2008 +0000
+++ b/doc/misc/ChangeLog	Mon Jan 28 03:51:31 2008 +0000
@@ -1,3 +1,8 @@
+2008-01-28  Michael Sperber  <sperber@deinprogramm.de>
+
+	* gnus.texi (Mail Source Specifiers): Document `group' specifier.
+	(Group Parameters): Document `mail-source' parameter.
+
 2008-01-27  Michael Albinus  <michael.albinus@gmx.de>
 
 	* tramp.texi (Inline methods): The hostname of the su(do)? methods
--- a/doc/misc/gnus.texi	Mon Jan 28 03:48:45 2008 +0000
+++ b/doc/misc/gnus.texi	Mon Jan 28 03:51:31 2008 +0000
@@ -3035,6 +3035,12 @@
 If it is set, the value is used as the method for posting message
 instead of @code{gnus-post-method}.
 
+@item mail-source
+@cindex mail-source
+If it is set, and the setting of @code{mail-sources} includes a
+@code{group} mail source (@pxref{Mail Sources}), the value is a
+mail source for this group.
+
 @item banner
 @cindex banner
 An item like @code{(banner . @var{regexp})} causes any part of an article
@@ -14145,6 +14151,21 @@
 @dfn{keywords}.  Keywords that are not explicitly specified are given
 default values.
 
+The @code{mail-sources} is global for all mail groups.  You can specify
+an additional mail source for a particular group by including the
+@code{group} mail specifier in @code{mail-sources}, and setting a
+@code{mail-source} group parameter (@pxref{Group Parameters}) specifying
+a single mail source.  When this is used, @code{mail-sources} is
+typically just @code{(group)}; the @code{mail-source} parameter for a
+group might look like this:
+
+@lisp
+(mail-source . (file :path "home/user/spools/foo.spool"))
+@end lisp
+
+This means that the group's (and only this group's) messages will be
+fetched from the spool file @samp{/user/spools/foo.spool}.
+
 The following mail source types are available:
 
 @table @code
@@ -14535,6 +14556,11 @@
          :user "user-name"
          :password "secret")
 @end lisp
+
+@item group
+Get the actual mail source from the @code{mail-source} group parameter,
+@xref{Group Parameters}.
+
 @end table
 
 @table @dfn
--- a/lisp/gnus/ChangeLog	Mon Jan 28 03:48:45 2008 +0000
+++ b/lisp/gnus/ChangeLog	Mon Jan 28 03:51:31 2008 +0000
@@ -1,3 +1,11 @@
+2008-01-24    Michael Sperber  <sperber@deinprogramm.de>
+
+	* mail-source.el (mail-sources): Add `group' choice.
+
+	* nnmail.el (nnmail-get-new-mail-1): Abstract this out to add another
+	parameter `in-group' to control into which group the articles go.
+	Add treatment of `group' mail-source.
+
 2008-01-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
--- a/lisp/gnus/mail-source.el	Mon Jan 28 03:48:45 2008 +0000
+++ b/lisp/gnus/mail-source.el	Mon Jan 28 03:51:31 2008 +0000
@@ -74,6 +74,8 @@
 	  (repeat :tag "List"
 	   (choice :format "%[Value Menu%] %v"
 		   :value (file)
+		   (cons :tag "Group parameter `mail-source'"
+			 (const :format "" group))
 		   (cons :tag "Spool file"
 			 (const :format "" file)
 			 (checklist :tag "Options" :greedy t
--- a/lisp/gnus/nnmail.el	Mon Jan 28 03:48:45 2008 +0000
+++ b/lisp/gnus/nnmail.el	Mon Jan 28 03:51:31 2008 +0000
@@ -1766,11 +1766,15 @@
       (symbol-value sym))))
 
 (defun nnmail-get-new-mail (method exit-func temp
-				   &optional group spool-func)
+			    &optional group spool-func)
   "Read new incoming mail."
+  (nnmail-get-new-mail-1 method exit-func temp group nil spool-func))
+
+(defun nnmail-get-new-mail-1 (method exit-func temp
+			      group in-group spool-func)
+
   (let* ((sources mail-sources)
 	 fetching-sources
-	 (group-in group)
 	 (i 0)
 	 (new 0)
 	 (total 0)
@@ -1778,6 +1782,18 @@
     (when (and (nnmail-get-value "%s-get-new-mail" method)
 	       sources)
       (while (setq source (pop sources))
+
+	;; Use group's parameter
+	(when (eq (car source) 'group)
+	  (let ((mail-sources
+		 (list
+		  (gnus-group-find-parameter
+		   (concat (symbol-name method) ":" group)
+		   'mail-source t))))
+	    (nnmail-get-new-mail-1 method exit-func temp
+				   group group spool-func))
+	  (setq source nil))
+	  
 	;; Hack to only fetch the contents of a single group's spool file.
 	(when (and (eq (car source) 'directory)
 		   (null nnmail-scan-directory-mail-source-once)
@@ -1816,9 +1832,10 @@
 			 (nnmail-split-incoming
 			  file ',(intern (format "%s-save-mail" method))
 			  ',spool-func
-			  (if (equal file orig-file)
-			      nil
-			    (nnmail-get-split-group orig-file ',source))
+			  (or in-group
+			      (if (equal file orig-file)
+				  nil
+				(nnmail-get-split-group orig-file ',source)))
 			  ',(intern (format "%s-active-number" method)))))))
 	  (incf total new)
 	  (incf i)))