From 6895dfe70b502a18bfacd57ba178ae5f10e45324 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 27 Aug 2015 22:30:44 -0400 Subject: 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. --- lisp/init-files.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp') 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) -- cgit v1.2.3