[gnus git] branch master updated: m0-13-62-gdac2389 =1= Make the imap mail-source's :mailbox handle a list

Adam Sj??gren <[email protected]> Sat, 05 Sep 2015 10:26:19 +0200
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  dac2389c304a108c6cb78c18e422f157aecbdb74 (commit)
      from  965fb88c162e2d725ee472a999eee94c08844d74 (commit)


- Log -----------------------------------------------------------------
commit dac2389c304a108c6cb78c18e422f157aecbdb74
Author: Adam Sjøgren <[email protected]>
Date:   Fri Sep 4 17:41:07 2015 +0200

    Make the imap mail-source's :mailbox handle a list
    
    * mail-source.el (mail-source-fetch-imap): allow :mailbox to be
    a list.

diff --git a/lisp/mail-source.el b/lisp/mail-source.el
index ad135d4..cf18fbe 100644
--- a/lisp/mail-source.el
+++ b/lisp/mail-source.el
@@ -1090,10 +1090,13 @@ This only works when `display-time' is enabled."
       (if (and (imap-open server port stream authentication buf)
 	       (imap-authenticate
 		user (or (cdr (assoc from mail-source-password-cache))
-			 password) buf)
-	       (imap-mailbox-select mailbox nil buf))
+                         password) buf))
+          (let ((mailbox-list (if (listp mailbox) mailbox (list mailbox))))
+            (dolist (mailbox mailbox-list)
+              (when (imap-mailbox-select mailbox nil buf)
 	  (let ((coding-system-for-write mail-source-imap-file-coding-system)
 		str)
+            (message "Fetching from %s..." mailbox)
 	    (with-temp-file mail-source-crash-box
 	      ;; Avoid converting 8-bit chars from inserted strings to
 	      ;; multibyte.
@@ -1128,7 +1131,7 @@ This only works when `display-time' is enabled."
 	       fetchflag nil buf))
 	    (if dontexpunge
 		(imap-mailbox-unselect buf)
-	      (imap-mailbox-close nil buf))
+              (imap-mailbox-close nil buf)))))
             (imap-close buf))
 	(imap-close buf)
 	;; We nix out the password in case the error
diff --git a/texi/gnus.texi b/texi/gnus.texi
index 1bc4279..8fcd38d 100644
--- a/texi/gnus.texi
+++ b/texi/gnus.texi
@@ -15018,7 +15018,8 @@ corresponding keywords.
 
 @item :mailbox
 The name of the mailbox to get mail from.  The default is @samp{INBOX}
-which normally is the mailbox which receives incoming mail.
+which normally is the mailbox which receives incoming mail. Instead of
+a single mailbox, this can be a list of mailboxes to fetch mail from.
 
 @item :predicate
 The predicate used to find articles to fetch.  The default, @samp{UNSEEN

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/mail-source.el |   11 +++++++----
 texi/gnus.texi      |    3 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project