* elmo.el (elmo-generic-folder-append-messages): Make
[elisp/wanderlust.git] / elmo / elmo-nmz.el
index cda62cb..5fb36b9 100644 (file)
@@ -189,29 +189,30 @@ If the value is a list, all elements are used as index paths for namazu."
                                            location strategy
                                            &optional section unseen)
   (when (file-exists-p location)
-    (insert-file-contents-as-binary location)
-    (unless (or (std11-field-body "To")
-               (std11-field-body "Cc")
-               (std11-field-body "Subject"))
-      (let (charset guess uid)
-       (erase-buffer)
-       (set-buffer-multibyte t)
-       (insert-file-contents location)
-       (setq charset (detect-mime-charset-region (point-min)
-                                                 (point-max)))
-       (goto-char (point-min))
-       (setq guess (mime-find-file-type location))
-       (setq uid (nth 2 (file-attributes location)))
-       (insert "From: " (concat (user-full-name uid)
-                                " <"(user-login-name uid) "@"
-                                (system-name) ">") "\n")
-       (insert "Subject: " location "\n")
-       (insert "Content-Type: "
-               (concat (nth 0 guess) "/" (nth 1 guess))
-               "; charset=" (upcase (symbol-name charset))
-               "\nMIME-Version: 1.0\n\n")
-       (encode-mime-charset-region (point-min) (point-max) charset)
-       (set-buffer-multibyte nil)))))
+    (prog1
+       (insert-file-contents-as-binary location)
+      (unless (or (std11-field-body "To")
+                 (std11-field-body "Cc")
+                 (std11-field-body "Subject"))
+       (let (charset guess uid)
+         (erase-buffer)
+         (set-buffer-multibyte t)
+         (insert-file-contents location)
+         (setq charset (detect-mime-charset-region (point-min)
+                                                   (point-max)))
+         (goto-char (point-min))
+         (setq guess (mime-find-file-type location))
+         (setq uid (nth 2 (file-attributes location)))
+         (insert "From: " (concat (user-full-name uid)
+                                  " <"(user-login-name uid) "@"
+                                  (system-name) ">") "\n")
+         (insert "Subject: " location "\n")
+         (insert "Content-Type: "
+                 (concat (nth 0 guess) "/" (nth 1 guess))
+                 "; charset=" (upcase (symbol-name charset))
+                 "\nMIME-Version: 1.0\n\n")
+         (encode-mime-charset-region (point-min) (point-max) charset)
+         (set-buffer-multibyte nil))))))
 
 (luna-define-method elmo-map-folder-list-message-locations
   ((folder elmo-nmz-folder))