X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fmailcap.el;h=01d8587f06a66e1b579b12f92586d24bb9d443fc;hp=5515a348b4c02b863e39856ee089f6e12f461323;hb=b83561e18ceb438203812786590893bd5fc2a6cc;hpb=b4bc300f0dcddc2b17bb50a3501ed6e6db1ef12c diff --git a/lisp/mailcap.el b/lisp/mailcap.el index 5515a348b..01d8587f0 100644 --- a/lisp/mailcap.el +++ b/lisp/mailcap.el @@ -1,6 +1,6 @@ ;;; mailcap.el --- MIME media types configuration -;; Copyright (C) 1998-2014 Free Software Foundation, Inc. +;; Copyright (C) 1998-2015 Free Software Foundation, Inc. ;; Author: William M. Perry ;; Lars Magne Ingebrigtsen @@ -152,6 +152,10 @@ This is a compatibility function for different Emacsen." (non-viewer . t) (type . "application/zip") ("copiousoutput")) + ("pdf" + (viewer . doc-view-mode) + (type . "application/pdf") + (test . (eq window-system 'x))) ("pdf" (viewer . "gv -safer %s") (type . "application/pdf") @@ -215,10 +219,6 @@ This is a compatibility function for different Emacsen." (viewer . vm-mode) (test . (fboundp 'vm-mode)) (type . "message/rfc822")) - ("rfc-*822" - (viewer . w3-mode) - (test . (fboundp 'w3-mode)) - (type . "message/rfc822")) ("rfc-*822" (viewer . view-mode) (type . "message/rfc822"))) @@ -252,10 +252,6 @@ This is a compatibility function for different Emacsen." (test . (eq window-system 'x)) ("needsx11"))) ("text" - ("plain" - (viewer . w3-mode) - (test . (fboundp 'w3-mode)) - (type . "text/plain")) ("plain" (viewer . view-mode) (test . (fboundp 'view-mode)) @@ -267,10 +263,6 @@ This is a compatibility function for different Emacsen." (viewer . enriched-decode) (test . (fboundp 'enriched-decode)) (type . "text/enriched")) - ("html" - (viewer . mm-w3-prepare-buffer) - (test . (fboundp 'w3-prepare-buffer)) - (type . "text/html")) ("dns" (viewer . dns-mode) (test . (fboundp 'dns-mode)) @@ -1072,6 +1064,18 @@ If FORCE, re-parse even if already parsed." common-mime-info))))) commands)) +(defun mailcap-view-mime (type) + "View the data in the current buffer that has MIME type TYPE. +`mailcap-mime-data' determines the method to use." + (let ((method (mailcap-mime-info type))) + (if (stringp method) + (shell-command-on-region (point-min) (point-max) + ;; Use stdin as the "%s". + (format method "-") + (current-buffer) + t) + (funcall method)))) + (provide 'mailcap) ;;; mailcap.el ends here