(defun mm-display-patch-inline (handle) (let (text) (with-temp-buffer (mm-insert-part handle) (diff-mode) (font-lock-fontify-buffer) (setq text (buffer-string))) (mm-insert-inline handle text))) (defun mm-display-elisp-inline (handle) (let (text) (with-temp-buffer (mm-insert-part handle) (emacs-lisp-mode) (font-lock-fontify-buffer) (setq text (buffer-string))) (mm-insert-inline handle text))) (defun mm-add-new-type (type displayer test auto-display inlined attachment-override) (push (list type displayer test) mm-inline-media-tests) (if auto-display (push type mm-automatic-display)) (if inlined (push type mm-inlined-types)) (if attachment-override (push type mm-attachment-override-types))) (eval-after-load "mm-decode" '(progn (mm-add-new-type "text/x-patch" 'mm-display-patch-inline '(fboundp 'diff-mode) t t t) (mm-add-new-type "application/x-patch" 'mm-display-patch-inline '(fboundp 'diff-mode) t t t) (mm-add-new-type "text/x-emacs-lisp" 'mm-display-elisp-inline 'identity t t t) (mm-add-new-type "application/emacs-lisp" 'mm-display-elisp-inline 'identity t t t)))