From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66033 Path: news.gmane.org!not-for-mail From: Michael Sperber Newsgroups: gmane.emacs.gnus.general Subject: Re: Patch submission: Allow group-local mail sources for nnmail Date: Thu, 03 Jan 2008 15:12:46 +0100 Message-ID: References: <86y7b7xeqp.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1199369611 19882 80.91.229.12 (3 Jan 2008 14:13:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Jan 2008 14:13:31 +0000 (UTC) Cc: ding@gnus.org To: Ted Zlatanov Original-X-From: ding-owner+M14526@lists.math.uh.edu Thu Jan 03 15:13:50 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1JAQpO-0000pC-Eo for ding-account@gmane.org; Thu, 03 Jan 2008 15:13:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1JAQoZ-0000JS-4d; Thu, 03 Jan 2008 08:12:55 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JAQoW-0000J7-VS for ding@lists.math.uh.edu; Thu, 03 Jan 2008 08:12:53 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JAQoV-0001hE-5p for ding@lists.math.uh.edu; Thu, 03 Jan 2008 08:12:52 -0600 Original-Received: from h615406.serverkompetenz.net ([81.169.143.132]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JAQoU-00085t-00 for ; Thu, 03 Jan 2008 15:12:50 +0100 Original-Received: from h615406.serverkompetenz.net (localhost [127.0.0.1]) by h615406.serverkompetenz.net (Postfix) with ESMTP id 5199F17149; Thu, 3 Jan 2008 15:12:49 +0100 (MET) Original-Received: from valmont.local (p5B204E56.dip.t-dialin.net [91.32.78.86]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by h615406.serverkompetenz.net (Postfix) with ESMTP id EB45F17141; Thu, 3 Jan 2008 15:12:48 +0100 (MET) Original-Received: by valmont.local (Postfix, from userid 2246) id C0712491CAC; Thu, 3 Jan 2008 15:12:46 +0100 (CET) In-Reply-To: <86y7b7xeqp.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu, 03 Jan 2008 06:42:06 -0600") User-Agent: Gnus/5.110007 (No Gnus v0.7) XEmacs/21.5-b28 (darwin) X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66033 Archived-At: --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Ted Zlatanov writes: > On Thu, 03 Jan 2008 07:48:52 +0100 Michael Sperber wrote:=20 > > 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 manua= l > 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? --=20 Cheers =3D8-} Mike Friede, V=F6lkerverst=E4ndigung und =FCberhaupt blabla --=-=-= Content-Disposition: inline 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 + + * gnus.texi (Mail Source Specifiers): Document `group' specifier. + (Group Parameters): Document `mail-source' parameter. + 2007-12-18 Reiner Steib * 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 --=-=-=--