diff options
| author | Lars Magne Ingebrigtsen | 2014-12-05 16:51:51 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-12-05 16:51:59 +0100 |
| commit | bee76e566c0e8d9f0b9fc6a48a36cf53e5408f91 (patch) | |
| tree | 28a2b90be38d01a044099a904af80d3ac7cfe71e /lisp | |
| parent | 7747e23ecd6c7b140a67812ad22421ef426a7a24 (diff) | |
| download | emacs-bee76e566c0e8d9f0b9fc6a48a36cf53e5408f91.tar.gz emacs-bee76e566c0e8d9f0b9fc6a48a36cf53e5408f91.zip | |
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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/eww.el | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26572c3649f..2fc3562ac5a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-12-05 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * net/eww.el (eww-display-pdf): Let mailcap determine how to | ||
| 4 | display PDF files (bug#19270). | ||
| 5 | |||
| 1 | 2014-12-05 Juri Linkov <juri@linkov.net> | 6 | 2014-12-05 Juri Linkov <juri@linkov.net> |
| 2 | 7 | ||
| 3 | Compare with the most recent window by default. | 8 | 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." | |||
| 493 | (shr-put-image data nil)) | 493 | (shr-put-image data nil)) |
| 494 | (goto-char (point-min))))) | 494 | (goto-char (point-min))))) |
| 495 | 495 | ||
| 496 | (declare-function mailcap-view-mime "mailcap" (type)) | ||
| 496 | (defun eww-display-pdf () | 497 | (defun eww-display-pdf () |
| 497 | (let ((data (buffer-substring (point) (point-max)))) | 498 | (let ((data (buffer-substring (point) (point-max)))) |
| 498 | (switch-to-buffer (get-buffer-create "*eww pdf*")) | 499 | (switch-to-buffer (get-buffer-create "*eww pdf*")) |
| @@ -500,7 +501,7 @@ See the `eww-search-prefix' variable for the search engine used." | |||
| 500 | (inhibit-read-only t)) | 501 | (inhibit-read-only t)) |
| 501 | (erase-buffer) | 502 | (erase-buffer) |
| 502 | (insert data) | 503 | (insert data) |
| 503 | (doc-view-mode))) | 504 | (mailcap-view-mime "application/pdf"))) |
| 504 | (goto-char (point-min))) | 505 | (goto-char (point-min))) |
| 505 | 506 | ||
| 506 | (defun eww-setup-buffer () | 507 | (defun eww-setup-buffer () |