(mail-source-imap-file-coding-system): New variable.
authorSimon Josefsson <jas@extundo.com>
Sun, 24 Sep 2000 19:33:00 +0000 (19:33 +0000)
committerSimon Josefsson <jas@extundo.com>
Sun, 24 Sep 2000 19:33:00 +0000 (19:33 +0000)
(mail-source-fetch-imap): Use it.

lisp/ChangeLog
lisp/mail-source.el

index 53f9e33..2f7d74c 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-24  Simon Josefsson  <simon@josefsson.org>
 
+       * mail-source.el (mail-source-imap-file-coding-system): New variable.
+       (mail-source-fetch-imap): Use it.
+
         * rfc2104.el (rfc2104-hexstring-to-bitstring): New function.
         (rfc2104-hash): Use it.
 
index 7bf3047..b1e92cd 100644 (file)
@@ -791,8 +791,12 @@ This only works when `display-time' is enabled."
   (autoload 'imap-error-text "imap")
   (autoload 'imap-message-flags-add "imap")
   (autoload 'imap-list-to-message-set "imap")
+  (autoload 'imap-range-to-message-set "imap")
   (autoload 'nnheader-ms-strip-cr "nnheader"))
 
+(defvar mail-source-imap-file-coding-system 'binary
+  "Coding system for the crashbox made by `mail-source-fetch-imap'.")
+
 (defun mail-source-fetch-imap (source callback)
   "Fetcher for imap sources."
   (mail-source-bind (imap source)
@@ -806,7 +810,7 @@ This only works when `display-time' is enabled."
                user (or (cdr (assoc from mail-source-password-cache))
                         password) buf)
               (imap-mailbox-select mailbox nil buf))
-         (let (str (coding-system-for-write 'binary))
+         (let (str (coding-system-for-write mail-source-imap-file-coding-system))
            (with-temp-file mail-source-crash-box
              ;; In some versions of FSF Emacs, inserting unibyte
              ;; string into multibyte buffer may convert 8-bit chars
@@ -831,7 +835,8 @@ This only works when `display-time' is enabled."
            (incf found (mail-source-callback callback server))
            (when (and remove fetchflag)
              (imap-message-flags-add
-              (imap-list-to-message-set remove) fetchflag nil buf))
+              (imap-range-to-message-set (gnus-compress-sequence remove))
+              fetchflag nil buf))
            (if dontexpunge
                (imap-mailbox-unselect buf)
              (imap-mailbox-close buf))