From 7b492ea6a87dc5ff2590d6bd132d32c3ab408286 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 1 Feb 2012 02:00:51 +0100 Subject: [PATCH] * mm-archive.el (mm-archive-list-files): Inline text and image parts. --- lisp/ChangeLog | 2 ++ lisp/mm-archive.el | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index da89607ab..929d8cb78 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-02-01 Lars Ingebrigtsen + * 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. diff --git a/lisp/mm-archive.el b/lisp/mm-archive.el index c8fced460..974c31c43 100644 --- a/lisp/mm-archive.el +++ b/lisp/mm-archive.el @@ -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 @@ -59,6 +59,10 @@ (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)) -- 2.25.1