(eval-and-compile
(autoload 'gnus-article-prepare-display "gnus-art")
(autoload 'vcard-parse-string "vcard")
- (autoload 'vcard-format-string "vcard"))
+ (autoload 'vcard-format-string "vcard")
+ (autoload 'diff-mode "diff-mode"))
;;;
;;; Functions for displaying various formats inline
(run-hooks 'gnus-article-decode-hook)
(gnus-article-prepare-display)
(setq handles gnus-article-mime-handles))
+ (goto-char (point-max))
+ (unless (bolp)
+ (insert "\n"))
+ (insert "----------\n\n")
(when handles
(setq gnus-article-mime-handles
- (append gnus-article-mime-handles handles)))
+ (nconc gnus-article-mime-handles
+ (if (listp (car handles))
+ handles (list handles)))))
(mm-handle-set-undisplayer
handle
`(lambda ()
'(background background-pixmap foreground)))
(delete-region ,(point-min-marker) ,(point-max-marker)))))))))
+(defun mm-display-patch-inline (handle)
+ (let (text)
+ (with-temp-buffer
+ (mm-insert-part handle)
+ (diff-mode)
+ (font-lock-fontify-buffer)
+ (when (fboundp 'extent-list)
+ (map-extents (lambda (ext ignored)
+ (set-extent-property ext 'duplicable t)
+ nil)
+ nil nil nil nil nil 'text-prop))
+ (setq text (buffer-string)))
+ (mm-insert-inline handle text)))
+
(provide 'mm-view)
;; mm-view.el ends here