diff options
author | Adam Sjøgren <asjo@koldfront.dk> | 2015-09-06 12:59:30 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2015-09-06 12:59:30 +0000 |
commit | 1770b2b10bd0cfd04851ca454f9be1d1164b103a (patch) | |
tree | 4d0b75e9e0fcaef097567e6ab08eba478510364f | |
parent | 3fb7881a0e320f380203c0f2dd16dfc7189af1e9 (diff) | |
download | emacs-1770b2b10bd0cfd04851ca454f9be1d1164b103a.tar.gz |
mail-source.el: Make the imap mail-source's :mailbox handle a list
* lisp/gnus/mail-source.el (mail-source-fetch-imap):
Allow :mailbox to be a list.
-rw-r--r-- | lisp/gnus/mail-source.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index ad135d4c2ed..cf18fbea17d 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/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,8 +1131,8 @@ This only works when `display-time' is enabled." fetchflag nil buf)) (if dontexpunge (imap-mailbox-unselect buf) - (imap-mailbox-close nil buf)) - (imap-close buf)) + (imap-mailbox-close nil buf))))) + (imap-close buf)) (imap-close buf) ;; We nix out the password in case the error ;; was because of a wrong password being given. |