summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-08-27 22:30:44 -0400
committerKyle Meyer <kyle@kyleam.com>2015-08-27 22:30:44 -0400
commit6895dfe70b502a18bfacd57ba178ae5f10e45324 (patch)
tree846e11ce357bb66d712ed6654a2d2eaa6caac3d1 /lisp
parentf309cff08710071f7cd22b49e8402d69ecfa98bf (diff)
downloademacs.d-6895dfe70b502a18bfacd57ba178ae5f10e45324.tar.gz
Don't use doc-view-mode for PDFs
In Emacs 25, mailcap-mime-data is consulted when opening PDFs, and mailcap-viewer-lessp prefers doc-view-mode over PDF specified in mailcap file because doc-view-mode is a symbol.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-files.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/init-files.el b/lisp/init-files.el
index 104ca44..ddfa001 100644
--- a/lisp/init-files.el
+++ b/lisp/init-files.el
@@ -7,6 +7,15 @@
(setq require-final-newline t
ffap-machine-p-known 'reject)
+(after 'mailcap
+ (mailcap-parse-mailcaps)
+ (pcase-dolist (`(_ . ,info)
+ (cdr (assoc-string "application" mailcap-mime-data)))
+ ;; Instead of deleting doc-view-mode entry, just make its test
+ ;; always fail.
+ (when (eq (cdr (assq 'viewer info)) 'doc-view-mode)
+ (setf (cdr (assq 'test info)) (lambda (&rest _) nil)))))
+
(defun km/rename-current-buffer-file ()
"Rename current buffer and file it is visiting."
(interactive)