Gnus development mailing list
 help / color / mirror / Atom feed
* Patch submission: Allow group-local mail sources for nnmail
@ 2008-01-01 17:23 Michael Sperber
  2008-01-02 19:29 ` Reiner Steib
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Sperber @ 2008-01-01 17:23 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]


Hi there,

I've had the following problem forever: I get *lots* of e-mail, and I
travel a lot.  I often have a slow Internet connection.  For this
reason, I pre-sort the e-mail into different IMAP folders on the server,
and would like to only selectively fetch what I want depending on where
I am.  Unfortunately, `mail-sources' is global to all groups---I would
really like to say "fetch the new mail for this group from this IMAP
folder".

To do this, I've added a `group' mail source which activates a
`mail-source' group parameter, which does the job.  The attached patch
is relative to today's CVS.

Could this be applied to the code?  Of course, I'm also happy to hear
suggestions for improvement.

2008-01-01  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-01  Michael Sperber  <sperber@deinprogramm.de>

	* gnus.texi (Mail Source Specifiers): Document `group' specifier.
	(Group Parameters): Document `mail-source' parameter.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

[-- Attachment #2: Type: text/plain, Size: 3373 bytes --]

Index: lisp/mail-source.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mail-source.el,v
retrieving revision 7.24
diff -u -r7.24 mail-source.el
--- lisp/mail-source.el	16 Dec 2007 04:23:18 -0000	7.24
+++ lisp/mail-source.el	1 Jan 2008 17:12:10 -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
Index: lisp/nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 7.38
diff -u -r7.38 nnmail.el
--- lisp/nnmail.el	16 Dec 2007 04:23:18 -0000	7.38
+++ lisp/nnmail.el	1 Jan 2008 17:12:11 -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,16 @@
     (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 +1830,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)))
Index: texi/gnus.texi
===================================================================
RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v
retrieving revision 7.267
diff -u -r7.267 gnus.texi
--- texi/gnus.texi	28 Dec 2007 22:28:04 -0000	7.267
+++ texi/gnus.texi	1 Jan 2008 17:12:16 -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 specifies the
+mail source for this group.
+
 @item banner
 @cindex banner
 An item like @code{(banner . @var{regexp})} causes any part of an article
@@ -14546,6 +14552,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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-01 17:23 Patch submission: Allow group-local mail sources for nnmail Michael Sperber
@ 2008-01-02 19:29 ` Reiner Steib
  2008-01-03  6:48   ` Michael Sperber
  0 siblings, 1 reply; 11+ messages in thread
From: Reiner Steib @ 2008-01-02 19:29 UTC (permalink / raw)
  To: Michael Sperber; +Cc: ding

On Tue, Jan 01 2008, Michael Sperber wrote:

> I've had the following problem forever: I get *lots* of e-mail, and I
> travel a lot.  I often have a slow Internet connection.  For this
> reason, I pre-sort the e-mail into different IMAP folders on the server,
> and would like to only selectively fetch what I want depending on where
> I am.  Unfortunately, `mail-sources' is global to all groups---I would
> really like to say "fetch the new mail for this group from this IMAP
> folder".
>
> To do this, I've added a `group' mail source which activates a
> `mail-source' group parameter, which does the job.  

How do you actually use it?  Hitting `M-g'
(gnus-group-get-new-news-this-group,
gnus-topic-get-new-news-this-topic) on the group?

> The attached patch is relative to today's CVS.
>
> Could this be applied to the code?

The patch is too large to be installed without legal papers.  AFAICS,
your assignments only cover XEmacs and AUCTeX.  So we need an
additional assignments, either for Gnus or for Emacs (which covers
Gnus as well).  If you are willing to sign, I'll send you the form
off-list.

> Of course, I'm also happy to hear suggestions for improvement.

It's not clear to me how to use it (after reading the patch to
gnus.texi).  Is the `mail-source' Group parameter boolean or a mail
source specification?  Is it necessary to adjust both, the group
parameter and the variable `mail-sources'?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-02 19:29 ` Reiner Steib
@ 2008-01-03  6:48   ` Michael Sperber
  2008-01-03 12:42     ` Ted Zlatanov
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Sperber @ 2008-01-03  6:48 UTC (permalink / raw)
  To: ding


Thanks for the prompt response!

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Tue, Jan 01 2008, Michael Sperber wrote:
>
>> I've had the following problem forever: I get *lots* of e-mail, and I
>> travel a lot.  I often have a slow Internet connection.  For this
>> reason, I pre-sort the e-mail into different IMAP folders on the server,
>> and would like to only selectively fetch what I want depending on where
>> I am.  Unfortunately, `mail-sources' is global to all groups---I would
>> really like to say "fetch the new mail for this group from this IMAP
>> folder".
>>
>> To do this, I've added a `group' mail source which activates a
>> `mail-source' group parameter, which does the job.  
>
> How do you actually use it?  Hitting `M-g'
> (gnus-group-get-new-news-this-group,
> gnus-topic-get-new-news-this-topic) on the group?

Yes.  Or I do ESC <level> g.

>> The attached patch is relative to today's CVS.
>>
>> Could this be applied to the code?
>
> The patch is too large to be installed without legal papers.  AFAICS,
> your assignments only cover XEmacs and AUCTeX.  So we need an
> additional assignments, either for Gnus or for Emacs (which covers
> Gnus as well).  If you are willing to sign, I'll send you the form
> off-list.

Absolutely!

> It's not clear to me how to use it (after reading the patch to
> gnus.texi).  Is the `mail-source' Group parameter boolean or a mail
> source specification? 

It's a mail-source specification.  Is this:

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

clearer?

> Is it necessary to adjust both, the group parameter and the variable
> `mail-sources'?

Yes.  I have `mail-sources' set to `group', and then `mail-source'
parameters for various groups.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-03  6:48   ` Michael Sperber
@ 2008-01-03 12:42     ` Ted Zlatanov
  2008-01-03 14:12       ` Michael Sperber
  0 siblings, 1 reply; 11+ messages in thread
From: Ted Zlatanov @ 2008-01-03 12:42 UTC (permalink / raw)
  To: Michael Sperber; +Cc: ding

On Thu, 03 Jan 2008 07:48:52 +0100 Michael Sperber <sperber@deinprogramm.de> wrote: 

MS> Thanks for the prompt response!

Hi Michael,

just FYI, your patch has some 80+ character lines, and code in Gnus has
to be 80 or less IIRC.  Also, can you add more information to the manual
instead of just a description for the new options?  If Reiner couldn't
figure it out easily, I doubt the rest of the users will have it better.

Thanks
Ted



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-03 12:42     ` Ted Zlatanov
@ 2008-01-03 14:12       ` Michael Sperber
  2008-01-03 17:58         ` Ted Zlatanov
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Sperber @ 2008-01-03 14:12 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 03 Jan 2008 07:48:52 +0100 Michael Sperber <sperber@deinprogramm.de> wrote: 
>
> MS> Thanks for the prompt response!
>
> Hi Michael,
>
> just FYI, your patch has some 80+ character lines, and code in Gnus has
> to be 80 or less IIRC.  Also, can you add more information to the manual
> instead of just a description for the new options?  If Reiner couldn't
> figure it out easily, I doubt the rest of the users will have it better.

Thanks for the review - is this better?

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

[-- Attachment #2: Type: text/plain, Size: 4471 bytes --]

Index: lisp/mail-source.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mail-source.el,v
retrieving revision 7.24
diff -u -r7.24 mail-source.el
--- lisp/mail-source.el	16 Dec 2007 04:23:18 -0000	7.24
+++ lisp/mail-source.el	3 Jan 2008 14:11:29 -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
Index: lisp/nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 7.38
diff -u -r7.38 nnmail.el
--- lisp/nnmail.el	16 Dec 2007 04:23:18 -0000	7.38
+++ lisp/nnmail.el	3 Jan 2008 14:11:29 -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)))
Index: texi/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/texi/ChangeLog,v
retrieving revision 7.378
diff -u -r7.378 ChangeLog
--- texi/ChangeLog	28 Dec 2007 22:28:04 -0000	7.378
+++ texi/ChangeLog	3 Jan 2008 14:11:30 -0000
@@ -1,3 +1,8 @@
+2008-01-01  Michael Sperber  <sperber@deinprogramm.de>
+
+	* gnus.texi (Mail Source Specifiers): Document `group' specifier.
+	(Group Parameters): Document `mail-source' parameter.
+
 2007-12-18  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus.texi (Group Parameters): Reorder the text and add a note about
Index: texi/gnus.texi
===================================================================
RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v
retrieving revision 7.267
diff -u -r7.267 gnus.texi
--- texi/gnus.texi	28 Dec 2007 22:28:04 -0000	7.267
+++ texi/gnus.texi	3 Jan 2008 14:11:35 -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
@@ -14156,6 +14162,12 @@
 @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.
+
 The following mail source types are available:
 
 @table @code
@@ -14546,6 +14558,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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-03 14:12       ` Michael Sperber
@ 2008-01-03 17:58         ` Ted Zlatanov
  2008-01-04  7:24           ` Michael Sperber
  0 siblings, 1 reply; 11+ messages in thread
From: Ted Zlatanov @ 2008-01-03 17:58 UTC (permalink / raw)
  To: Michael Sperber; +Cc: ding

On Thu, 03 Jan 2008 15:12:46 +0100 Michael Sperber <sperber@deinprogramm.de> wrote: 

MS> Thanks for the review - is this better?

Looks great.  Could you add an example of a mail-source use to the
manual, as both the actual setting you'd use, and what it does?

Thanks (Danke :)
Ted



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-03 17:58         ` Ted Zlatanov
@ 2008-01-04  7:24           ` Michael Sperber
  2008-01-04 11:59             ` Reiner Steib
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Sperber @ 2008-01-04  7:24 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 03 Jan 2008 15:12:46 +0100 Michael Sperber <sperber@deinprogramm.de> wrote: 
>
> MS> Thanks for the review - is this better?
>
> Looks great.  Could you add an example of a mail-source use to the
> manual, as both the actual setting you'd use, and what it does?

Like so?

--snip--
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")
(group)
@end lisp

This means that the group's (and only this group's) messages will be
fetched from the spool file @code{home/user/spools/foo.spool}.
--snip--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-04  7:24           ` Michael Sperber
@ 2008-01-04 11:59             ` Reiner Steib
  2008-01-04 12:28               ` Michael Sperber
  2008-01-16  7:20               ` Michael Sperber
  0 siblings, 2 replies; 11+ messages in thread
From: Reiner Steib @ 2008-01-04 11:59 UTC (permalink / raw)
  To: Michael Sperber; +Cc: ding

On Fri, Jan 04 2008, Michael Sperber wrote:

> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Could you add an example of a mail-source use to the manual, as
>> both the actual setting you'd use, and what it does?
>
> Like so?

Clearer than before.

> --snip--
> 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")
> (group)
> @end lisp

Missing ")" (in the first line?).

I don't understand the "(group)" here.  I would have thought "(group)"
must appear in the `mail-sources' variable, but not in the group
parameter.

> This means that the group's (and only this group's) messages will be
> fetched from the spool file @code{home/user/spools/foo.spool}.
> --snip--

This should probably read @samp{/home/user/spools/foo.spool} (absolute
file name and @samp{}). 

I think when using a `file' mail source in the group parameter, a
similar setup can already be achieved using a `directory' mail source
(though it doesn't allow fetching only a single source).

But you mentioned that you fetch from several IMAP folders to local
(nnml?) groups.  i.e. you need to add a full `imap' mail source for
each group or do you use some function or macro for the setup?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-04 11:59             ` Reiner Steib
@ 2008-01-04 12:28               ` Michael Sperber
  2008-01-16  7:20               ` Michael Sperber
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Sperber @ 2008-01-04 12:28 UTC (permalink / raw)
  To: ding


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> Missing ")" (in the first line?).
> I don't understand the "(group)" here.  I would have thought "(group)"
> must appear in the `mail-sources' variable, but not in the group
> parameter.

Cut-n-pasto.  Sorry.

--snip--
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}.
--snip--

> I think when using a `file' mail source in the group parameter, a
> similar setup can already be achieved using a `directory' mail source
> (though it doesn't allow fetching only a single source).

Yes, that's what I was using before.  I thought a `file' specifier would
make for a simpler example.

> But you mentioned that you fetch from several IMAP folders to local
> (nnml?) groups.  i.e. you need to add a full `imap' mail source for
> each group or do you use some function or macro for the setup?

I specify a full source.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-04 11:59             ` Reiner Steib
  2008-01-04 12:28               ` Michael Sperber
@ 2008-01-16  7:20               ` Michael Sperber
  2008-01-24 22:23                 ` Reiner Steib
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Sperber @ 2008-01-16  7:20 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]


The copyright assignment has just been confirmed by the FSF.  Here's the
current version of the patch.  Could it be applied?  Many thanks for the
review, everyone!

lisp/ChangeLog

2008-01-01  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.

texi/ChangeLog

2008-01-01  Michael Sperber  <sperber@deinprogramm.de>

	* gnus.texi (Mail Source Specifiers): Document `group' specifier.
	(Group Parameters): Document `mail-source' parameter.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

[-- Attachment #2: Type: text/plain, Size: 4215 bytes --]

Index: lisp/mail-source.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mail-source.el,v
retrieving revision 7.24
diff -u -r7.24 mail-source.el
--- lisp/mail-source.el	16 Dec 2007 04:23:18 -0000	7.24
+++ lisp/mail-source.el	16 Jan 2008 07:18:40 -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
Index: lisp/nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 7.38
diff -u -r7.38 nnmail.el
--- lisp/nnmail.el	16 Dec 2007 04:23:18 -0000	7.38
+++ lisp/nnmail.el	16 Jan 2008 07:18:40 -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)))
Index: texi/gnus.texi
===================================================================
RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v
retrieving revision 7.267
diff -u -r7.267 gnus.texi
--- texi/gnus.texi	28 Dec 2007 22:28:04 -0000	7.267
+++ texi/gnus.texi	16 Jan 2008 07:18:46 -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
@@ -14156,6 +14162,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
@@ -14546,6 +14567,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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Patch submission: Allow group-local mail sources for nnmail
  2008-01-16  7:20               ` Michael Sperber
@ 2008-01-24 22:23                 ` Reiner Steib
  0 siblings, 0 replies; 11+ messages in thread
From: Reiner Steib @ 2008-01-24 22:23 UTC (permalink / raw)
  To: Michael Sperber; +Cc: ding

On Wed, Jan 16 2008, Michael Sperber wrote:

> The copyright assignment has just been confirmed by the FSF.

[Yes, it's in the copyright list as well.]

> Here's the current version of the patch.  Could it be applied?

Done.

> Many thanks for the review, everyone!

Thanks again for your contribution.

Could interested people please try it and see if the documentation is
comprehensible?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-01-24 22:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-01 17:23 Patch submission: Allow group-local mail sources for nnmail Michael Sperber
2008-01-02 19:29 ` Reiner Steib
2008-01-03  6:48   ` Michael Sperber
2008-01-03 12:42     ` Ted Zlatanov
2008-01-03 14:12       ` Michael Sperber
2008-01-03 17:58         ` Ted Zlatanov
2008-01-04  7:24           ` Michael Sperber
2008-01-04 11:59             ` Reiner Steib
2008-01-04 12:28               ` Michael Sperber
2008-01-16  7:20               ` Michael Sperber
2008-01-24 22:23                 ` Reiner Steib

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