+2014-12-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * mailcap.el (mailcap-mime-data): Add doc-view-mode as a viewer for
+ PDFs.
+ (mailcap-view-mime): New function.
+
2014-12-01 Glenn Morris <rgm@gnu.org>
* gnus-cloud.el (gnus-cloud): Add :version tag.
(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")
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