From: Lars Ingebrigtsen Date: Wed, 1 Feb 2012 01:00:51 +0000 (+0100) Subject: * mm-archive.el (mm-archive-list-files): Inline text and image parts. X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=7b492ea6a87dc5ff2590d6bd132d32c3ab408286 * mm-archive.el (mm-archive-list-files): Inline text and image parts. --- 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))