From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86231 Path: news.gmane.org!not-for-mail From: Michael Sperber Newsgroups: gmane.emacs.gnus.general Subject: PATCH: Unbreak `group' option for `mail-sources' Date: Sun, 18 Oct 2015 18:03:06 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1445210176 16401 80.91.229.3 (18 Oct 2015 23:16:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2015 23:16:16 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34465@lists.math.uh.edu Mon Oct 19 01:16:04 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZnxBL-0002mn-3Q for ding-account@gmane.org; Mon, 19 Oct 2015 01:16:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1ZnxAO-00028X-GX; Sun, 18 Oct 2015 18:15:04 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZnqQY-00009H-9m for ding@lists.math.uh.edu; Sun, 18 Oct 2015 11:03:18 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZnqQV-0005v1-3Z for ding@lists.math.uh.edu; Sun, 18 Oct 2015 11:03:18 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZnqQS-0006Ps-JA for ding@gnus.org; Sun, 18 Oct 2015 18:03:12 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZnqQR-00045O-Rm for ding@gnus.org; Sun, 18 Oct 2015 18:03:11 +0200 Original-Received: from p4fd1e58b.dip0.t-ipconnect.de ([79.209.229.139]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 18 Oct 2015 18:03:11 +0200 Original-Received: from sperber by p4fd1e58b.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 18 Oct 2015 18:03:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 109 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p4fd1e58b.dip0.t-ipconnect.de User-Agent: Gnus/5.130014 (Ma Gnus v0.14) XEmacs/21.5-b34 (darwin) Cancel-Lock: sha1:cUG18BXS/cBR8xHS9uRQ4Gc6Qq8= X-Spam-Score: -2.9 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86231 Archived-At: --=-=-= Content-Type: text/plain The `group' option for `mail-sources' has been broken for quite a while. The attached patch fixes it. Could someone apply and push? -- Regards, Mike --=-=-= Content-Type: text/plain Content-Disposition: inline commit d164741a74ba8145476c478f2079c9e3d9d69567 Author: Mike Sperber Date: Sun Oct 18 17:39:34 2015 +0200 * nnml.el (nnml-retrieve-groups, nnml-request-scan): * nnmail.el (nnmail-get-new-mail-per-group): (nnmail-get-new-mail-1): Unbreak `group' option for `mail-sources'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2f7fd2b..979a845 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2015-10-18 Michael Sperber + * nnml.el (nnml-retrieve-groups, nnml-request-scan): + * nnmail.el (nnmail-get-new-mail-per-group): + (nnmail-get-new-mail-1): Unbreak `group' option for `mail-sources'. + +2015-10-18 Michael Sperber + * message.el (message-get-reply-headers): In addition to `mail-dont-reply-to-names', bind `rmail-dont-reply-to-names', which is used in XEmacs. diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 7efb154..f3ba169 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1792,6 +1792,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." "Read new incoming mail." (nnmail-get-new-mail-1 method exit-func temp group nil spool-func)) +(defun nnmail-get-new-mail-per-group () + "Tell us whether the mail-sources specify that `nnmail-get-new-mail' should +be called once per group or once for all groups." + (or (assq 'group mail-sources) + (assq 'directory mail-sources))) + (defun nnmail-get-new-mail-1 (method exit-func temp group in-group spool-func) (let* ((sources mail-sources) @@ -1804,7 +1810,8 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." sources) (while (setq source (pop sources)) ;; Use group's parameter - (when (eq (car source) 'group) + (when (and (eq (car source) 'group) + group) (let ((mail-sources (list (gnus-group-find-parameter diff --git a/lisp/nnml.el b/lisp/nnml.el index c825e09..33eae1c 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -268,10 +268,35 @@ non-nil.") (max (1+ (- (cdr active) (car active))) 0) (car active) (cdr active) group))))))) +(deffoo nnml-retrieve-groups (groups &optional server) + (when nnml-get-new-mail + (if (nnmail-get-new-mail-per-group) + (dolist (group groups) + (nnml-request-scan group server)) + (nnml-request-scan nil server))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (dolist (group groups) + (let* ((entry (assoc group nnml-group-alist)) + (active (nth 1 entry))) + (if (consp active) + (insert (format "211 %d %d %d %s\n" + (max (1+ (- (cdr active) (car active))) 0) + (car active) (cdr active) group)))))) + 'group) + (deffoo nnml-request-scan (&optional group server) (setq nnml-article-file-alist nil) (nnml-possibly-change-directory group server) - (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group)) + (cond + (group + (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group)) + ((nnmail-get-new-mail-per-group) + (nnml-request-list) + (dolist (entry nnml-group-alist) + (nnml-request-scan (car entry) server))) + (t + (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory nil)))) (deffoo nnml-close-group (group &optional server) (setq nnml-article-file-alist nil) --=-=-=--