diff options
| author | Adam Sjøgren | 2015-09-06 12:59:30 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2015-09-06 12:59:30 +0000 |
| commit | 1770b2b10bd0cfd04851ca454f9be1d1164b103a (patch) | |
| tree | 4d0b75e9e0fcaef097567e6ab08eba478510364f | |
| parent | 3fb7881a0e320f380203c0f2dd16dfc7189af1e9 (diff) | |
| download | emacs-1770b2b10bd0cfd04851ca454f9be1d1164b103a.tar.gz emacs-1770b2b10bd0cfd04851ca454f9be1d1164b103a.zip | |
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." | |||
| 1090 | (if (and (imap-open server port stream authentication buf) | 1090 | (if (and (imap-open server port stream authentication buf) |
| 1091 | (imap-authenticate | 1091 | (imap-authenticate |
| 1092 | user (or (cdr (assoc from mail-source-password-cache)) | 1092 | user (or (cdr (assoc from mail-source-password-cache)) |
| 1093 | password) buf) | 1093 | password) buf)) |
| 1094 | (imap-mailbox-select mailbox nil buf)) | 1094 | (let ((mailbox-list (if (listp mailbox) mailbox (list mailbox)))) |
| 1095 | (dolist (mailbox mailbox-list) | ||
| 1096 | (when (imap-mailbox-select mailbox nil buf) | ||
| 1095 | (let ((coding-system-for-write mail-source-imap-file-coding-system) | 1097 | (let ((coding-system-for-write mail-source-imap-file-coding-system) |
| 1096 | str) | 1098 | str) |
| 1099 | (message "Fetching from %s..." mailbox) | ||
| 1097 | (with-temp-file mail-source-crash-box | 1100 | (with-temp-file mail-source-crash-box |
| 1098 | ;; Avoid converting 8-bit chars from inserted strings to | 1101 | ;; Avoid converting 8-bit chars from inserted strings to |
| 1099 | ;; multibyte. | 1102 | ;; multibyte. |
| @@ -1128,8 +1131,8 @@ This only works when `display-time' is enabled." | |||
| 1128 | fetchflag nil buf)) | 1131 | fetchflag nil buf)) |
| 1129 | (if dontexpunge | 1132 | (if dontexpunge |
| 1130 | (imap-mailbox-unselect buf) | 1133 | (imap-mailbox-unselect buf) |
| 1131 | (imap-mailbox-close nil buf)) | 1134 | (imap-mailbox-close nil buf))))) |
| 1132 | (imap-close buf)) | 1135 | (imap-close buf)) |
| 1133 | (imap-close buf) | 1136 | (imap-close buf) |
| 1134 | ;; We nix out the password in case the error | 1137 | ;; We nix out the password in case the error |
| 1135 | ;; was because of a wrong password being given. | 1138 | ;; was because of a wrong password being given. |