X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmm-decode.el;h=f2ab1b0622615ca65b8472ba2154dc2f1128e6c5;hb=0651fabaac80cf08698f066dae0af33f29b91a9a;hp=c325f867397a91d4671d4925e4d9b602d0c0dfc8;hpb=39f092ce75bd0b6c91360618c4bd7ddf42c9b006;p=gnus diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index c325f8673..f2ab1b062 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -36,7 +36,8 @@ "Display of MIME in mail and news articles." :link '(custom-manual "(emacs-mime)Customization") :group 'mail - :group 'news) + :group 'news + :group 'multimedia) ;;; Convenience macros. @@ -117,6 +118,7 @@ ("text/x-patch" mm-display-patch-inline (lambda (handle) (locate-library "diff-mode"))) + ("application/emacs-lisp" mm-display-elisp-inline identity) ("text/html" mm-inline-text (lambda (handle) @@ -151,7 +153,7 @@ (defcustom mm-inlined-types '("image/.*" "text/.*" "message/delivery-status" "message/rfc822" - "message/partial" + "message/partial" "application/emacs-lisp" "application/pgp-signature") "List of media types that are to be displayed inline." :type '(repeat string) @@ -160,7 +162,8 @@ (defcustom mm-automatic-display '("text/plain" "text/enriched" "text/richtext" "text/html" "text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*" - "message/rfc822" "text/x-patch" "application/pgp-signature") + "message/rfc822" "text/x-patch" "application/pgp-signature" + "application/emacs-lisp") "A list of MIME types to be displayed automatically." :type '(repeat string) :group 'mime-display) @@ -368,6 +371,7 @@ external if displayed external." (buffer-disable-undo) (mm-set-buffer-file-coding-system mm-binary-coding-system) (insert-buffer-substring cur) + (goto-char (point-min)) (message "Viewing with %s" method) (let ((mm (current-buffer)) (non-viewer (assq 'non-viewer @@ -766,27 +770,29 @@ external if displayed external." (prog1 (setq spec (ignore-errors - (if (fboundp 'make-glyph) - (cond - ((equal type "xbm") - ;; xbm images require special handling, since - ;; the only way to create glyphs from these - ;; (without a ton of work) is to write them - ;; out to a file, and then create a file - ;; specifier. - (let ((file (make-temp-name - (expand-file-name "emm.xbm" - mm-tmp-directory)))) - (unwind-protect - (progn - (write-region (point-min) (point-max) file) - (make-glyph (list (cons 'x file)))) - (ignore-errors - (delete-file file))))) - (t - (make-glyph - (vector (intern type) :data (buffer-string))))) - (create-image (buffer-string) (intern type) 'data-p)))) + ;; Avoid testing `make-glyph' since W3 may define + ;; a bogus version of it. + (if (fboundp 'create-image) + (create-image (buffer-string) (intern type) 'data-p) + (cond + ((equal type "xbm") + ;; xbm images require special handling, since + ;; the only way to create glyphs from these + ;; (without a ton of work) is to write them + ;; out to a file, and then create a file + ;; specifier. + (let ((file (make-temp-name + (expand-file-name "emm.xbm" + mm-tmp-directory)))) + (unwind-protect + (progn + (write-region (point-min) (point-max) file) + (make-glyph (list (cons 'x file)))) + (ignore-errors + (delete-file file))))) + (t + (make-glyph + (vector (intern type) :data (buffer-string)))))))) (mm-handle-set-cache handle spec)))))) (defun mm-image-fit-p (handle)