summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-04-20 20:44:40 +0800
committerJSDurand <mmemmew@gmail.com>2021-04-20 20:44:40 +0800
commit51b69c4221e14d3a9e4371e5ae4516e50104e98e (patch)
treebd75683278f045fe25cfed281e436ca28f7dc999
parent3d4b11ee83c86d764ab9b2dcb36c3354983c1426 (diff)
Use pdf-view to view PDF files if available.
* eww-conf.el (mailcap-prefer-mailcap-viewers): (mailcap-user-mime-data): Set the user-data since otherwise this should be set via a dedicated mailcap file, which is cumbersome to specify pdf-view-mode in Emacs, as far as I know.
-rw-r--r--eww-conf.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/eww-conf.el b/eww-conf.el
index d3f3173..c9a3d79 100644
--- a/eww-conf.el
+++ b/eww-conf.el
@@ -20,6 +20,18 @@
(setq eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point))
(setq eww-browse-url-new-window-is-tab nil)
+;;; Use pdf-view to view PDF files if available.
+
+(setq mailcap-prefer-mailcap-viewers nil)
+
+(setq mailcap-user-mime-data
+ '(((viewer . pdf-view-mode)
+ (type . "application/pdf")
+ (test . window-system))
+ ((viewer . doc-view-mode)
+ (type . "application/pdf")
+ (test . window-system))))
+
;; key-bindings
(define-key global-map (vector ?\s-w) #'durand-eww-map)