aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Sperber2015-10-20 06:10:37 +0000
committerKatsumi Yamaoka2015-10-20 06:10:37 +0000
commit10df0310cb8f43818eace6288cadaae62bd82eb6 (patch)
tree4e423ee8da1aedad1355c18c653a8d64f02c2454 /lisp
parent04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0 (diff)
downloademacs-10df0310cb8f43818eace6288cadaae62bd82eb6.tar.gz
emacs-10df0310cb8f43818eace6288cadaae62bd82eb6.zip
Unbreak `group' option for `mail-sources'
* 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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/nnmail.el9
-rw-r--r--lisp/gnus/nnml.el27
2 files changed, 34 insertions, 2 deletions
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 7efb1543815..f3ba169b58c 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1792,6 +1792,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1792 "Read new incoming mail." 1792 "Read new incoming mail."
1793 (nnmail-get-new-mail-1 method exit-func temp group nil spool-func)) 1793 (nnmail-get-new-mail-1 method exit-func temp group nil spool-func))
1794 1794
1795(defun nnmail-get-new-mail-per-group ()
1796 "Tell us whether the mail-sources specify that `nnmail-get-new-mail' should
1797be called once per group or once for all groups."
1798 (or (assq 'group mail-sources)
1799 (assq 'directory mail-sources)))
1800
1795(defun nnmail-get-new-mail-1 (method exit-func temp 1801(defun nnmail-get-new-mail-1 (method exit-func temp
1796 group in-group spool-func) 1802 group in-group spool-func)
1797 (let* ((sources mail-sources) 1803 (let* ((sources mail-sources)
@@ -1804,7 +1810,8 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1804 sources) 1810 sources)
1805 (while (setq source (pop sources)) 1811 (while (setq source (pop sources))
1806 ;; Use group's parameter 1812 ;; Use group's parameter
1807 (when (eq (car source) 'group) 1813 (when (and (eq (car source) 'group)
1814 group)
1808 (let ((mail-sources 1815 (let ((mail-sources
1809 (list 1816 (list
1810 (gnus-group-find-parameter 1817 (gnus-group-find-parameter
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index c825e097481..33eae1c166e 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -268,10 +268,35 @@ non-nil.")
268 (max (1+ (- (cdr active) (car active))) 0) 268 (max (1+ (- (cdr active) (car active))) 0)
269 (car active) (cdr active) group))))))) 269 (car active) (cdr active) group)))))))
270 270
271(deffoo nnml-retrieve-groups (groups &optional server)
272 (when nnml-get-new-mail
273 (if (nnmail-get-new-mail-per-group)
274 (dolist (group groups)
275 (nnml-request-scan group server))
276 (nnml-request-scan nil server)))
277 (with-current-buffer nntp-server-buffer
278 (erase-buffer)
279 (dolist (group groups)
280 (let* ((entry (assoc group nnml-group-alist))
281 (active (nth 1 entry)))
282 (if (consp active)
283 (insert (format "211 %d %d %d %s\n"
284 (max (1+ (- (cdr active) (car active))) 0)
285 (car active) (cdr active) group))))))
286 'group)
287
271(deffoo nnml-request-scan (&optional group server) 288(deffoo nnml-request-scan (&optional group server)
272 (setq nnml-article-file-alist nil) 289 (setq nnml-article-file-alist nil)
273 (nnml-possibly-change-directory group server) 290 (nnml-possibly-change-directory group server)
274 (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group)) 291 (cond
292 (group
293 (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group))
294 ((nnmail-get-new-mail-per-group)
295 (nnml-request-list)
296 (dolist (entry nnml-group-alist)
297 (nnml-request-scan (car entry) server)))
298 (t
299 (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory nil))))
275 300
276(deffoo nnml-close-group (group &optional server) 301(deffoo nnml-close-group (group &optional server)
277 (setq nnml-article-file-alist nil) 302 (setq nnml-article-file-alist nil)