From bee76e566c0e8d9f0b9fc6a48a36cf53e5408f91 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Fri, 5 Dec 2014 16:51:51 +0100 Subject: [PATCH] Make eww use mailcap when displaying PDF files Fixes: debbugs:19270 * net/eww.el (eww-display-pdf): Let mailcap determine how to display PDF files. --- etc/NEWS | 2 ++ lisp/ChangeLog | 5 +++++ lisp/net/eww.el | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 9d204cfe8ad..bb749e87501 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -210,6 +210,8 @@ xml.el/libxml2 DOM, and a new package dom.el has been added to interact with this DOM. See the Emacs Lisp manual for interface details. +*** `mailcap-mime-data' is now consulted when displaying PDF files. + ** Message mode *** text/html messages that contain inline image parts will be diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26572c3649f..2fc3562ac5a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-05 Lars Magne Ingebrigtsen + + * net/eww.el (eww-display-pdf): Let mailcap determine how to + display PDF files (bug#19270). + 2014-12-05 Juri Linkov Compare with the most recent window by default. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 73abd26d8c5..e88afb50326 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -493,6 +493,7 @@ See the `eww-search-prefix' variable for the search engine used." (shr-put-image data nil)) (goto-char (point-min))))) +(declare-function mailcap-view-mime "mailcap" (type)) (defun eww-display-pdf () (let ((data (buffer-substring (point) (point-max)))) (switch-to-buffer (get-buffer-create "*eww pdf*")) @@ -500,7 +501,7 @@ See the `eww-search-prefix' variable for the search engine used." (inhibit-read-only t)) (erase-buffer) (insert data) - (doc-view-mode))) + (mailcap-view-mime "application/pdf"))) (goto-char (point-min))) (defun eww-setup-buffer () -- 2.39.2