* mm-archive.el (mm-archive-list-files): Inline text and image parts.
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 1 Feb 2012 01:00:51 +0000 (02:00 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 1 Feb 2012 01:00:51 +0000 (02:00 +0100)
lisp/ChangeLog
lisp/mm-archive.el

index da89607..929d8cb 100644 (file)
@@ -1,5 +1,7 @@
 2012-02-01  Lars Ingebrigtsen  <larsi@gnus.org>
 
+       * mm-archive.el (mm-archive-list-files): Inline text and image parts.
+
        * mm-decode.el (mm-shr): Make sure that the HTML ends with a newline.
        Otherwise inserting text into the Gnus buffer can look odd.
 
index c8fced4..974c31c 100644 (file)
@@ -51,7 +51,7 @@
 
 (defun mm-archive-list-files (dir)
   (let ((handles nil)
-       type)
+       type disposition)
     (dolist (file (directory-files dir))
       (unless (member file '("." ".."))
        (with-temp-buffer
            (setq type (mailcap-extension-to-mime (match-string 1 file))))
          (unless type
            (setq type "application/octet-stream"))
+         (setq disposition
+               (if (string-match "^image/\\|^text/" type)
+                   "inline"
+                 "attachment"))
          (insert (format "Content-type: %s\n" type))
          (insert "Content-Transfer-Encoding: 8bit\n\n")
          (insert-file-contents (expand-file-name file dir))
@@ -66,7 +70,7 @@
           (mm-make-handle (mm-copy-to-buffer)
                           (list type)
                           '8bit nil
-                          `("attachment" (filename . ,file))
+                          `(,disposition (filename . ,file))
                           nil nil nil)
           handles))))
     handles))