X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmm-view.el;h=1fc7992150a2ba5fca64c98d2ccadbce7e31c764;hb=f9c8170d647a9e61dd1d8bb7c4f7d4d8c6721280;hp=c7cc4dc81e8477a372d71f21d921b503acdd649c;hpb=daea6bb7f5bda46077dabaf7a2ab4450df400fa7;p=elisp%2Fgnus.git- diff --git a/lisp/mm-view.el b/lisp/mm-view.el index c7cc4dc..1fc7992 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -28,6 +28,11 @@ (require 'mm-bodies) (require 'mm-decode) +(eval-and-compile + (autoload 'gnus-article-prepare-display "gnus-art") + (autoload 'vcard-parse-string "vcard") + (autoload 'vcard-format-string "vcard")) + ;;; ;;; Functions for displaying various formats inline ;;; @@ -66,7 +71,8 @@ (save-restriction (narrow-to-region b (point)) (save-window-excursion - (let ((w3-strict-width width)) + (let ((w3-strict-width width) + (url-standalone-mode t)) (w3-region (point-min) (point-max))))) (mm-handle-set-undisplayer handle @@ -86,6 +92,13 @@ (enriched-decode (point-min) (point-max)) (setq text (buffer-string))))) (mm-insert-inline handle text)) + ((equal type "x-vcard") + (mm-insert-inline + handle + (concat "\n-- \n" + (vcard-format-string + (vcard-parse-string (mm-get-part handle) + 'vcard-standard-filter))))) (t (setq text (mm-get-part handle)) (let ((b (point)) @@ -121,17 +134,34 @@ (defun mm-w3-prepare-buffer () (require 'w3) - (w3-prepare-buffer)) - -(eval-and-compile - (autoload 'gnus-article-prepare-display "gnus-art")) + (let ((url-standalone-mode t)) + (w3-prepare-buffer))) (defun mm-view-message () + (mm-enable-multibyte) (gnus-article-prepare-display) (run-hooks 'gnus-article-decode-hook) (fundamental-mode) (goto-char (point-min))) +(defun mm-inline-message (handle) + (let ((b (point))) + (save-excursion + (save-restriction + (narrow-to-region b b) + (mm-insert-part handle) + (run-hooks 'gnus-article-decode-hook) + (gnus-article-prepare-display) + (mm-handle-set-undisplayer + handle + `(lambda () + (let (buffer-read-only) + (mapc (lambda (prop) + (remove-specifier + (face-property 'default prop) (current-buffer))) + '(background background-pixmap foreground)) + (delete-region ,(point-min-marker) ,(point-max-marker))))))))) + (provide 'mm-view) ;; mm-view.el ends here