Changes committed gnus/lisp (ChangeLog mail-source.el nnmail.el)

"Reiner Steib" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog mail-source.el nnmail.el

* 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.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1741 gnus/lisp/ChangeLog:7.1742
--- ChangeLog:7.1741	Wed Jan 23 08:48:31 2008
+++ ChangeLog	Thu Jan 24 23:16:33 2008
@@ -1,3 +1,11 @@
+2008-01-24    Michael Sperber  <[email protected]>
+
+	* 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-23  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-art.el (gnus-insert-mime-button): Don't decode description.
Index: mail-source.el
diff -u gnus/lisp/mail-source.el:7.25 gnus/lisp/mail-source.el:7.26
--- mail-source.el:7.25	Sun Jan 20 06:23:57 2008
+++ mail-source.el	Thu Jan 24 23:16:33 2008
@@ -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
Index: nnmail.el
diff -u gnus/lisp/nnmail.el:7.39 gnus/lisp/nnmail.el:7.40
--- nnmail.el:7.39	Sun Jan 20 06:23:57 2008
+++ nnmail.el	Thu Jan 24 23:16:33 2008
@@ -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)))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.