fixing the dire situation with viewing pdfs

This commit is contained in:
Grigory Shipunov 2020-11-18 01:19:11 +01:00
parent d78cdf6cc7
commit 633a1cdc6c
No known key found for this signature in database
GPG key ID: 77BB6C3E4771EE7C

29
init.el
View file

@ -94,32 +94,9 @@
;; worked"™ in vim? That's what you pay with for org mode ;; worked"™ in vim? That's what you pay with for org mode
(add-hook 'cc-mode-hook 'tabs-yay) (add-hook 'cc-mode-hook 'tabs-yay)
;; time to throw out this "DocView" abomination: full featured pdf ;; pdftools ftw, docview is shit that needs to be left in the past
;; viewer of antiquity, that emacs uses today! (require 'pdf-tools)
(defun ensc/mailcap-mime-data-filter (filter) (pdf-loader-install)
(mapcar (lambda(major)
(append (list (car major))
(remove nil
(mapcar (lambda(minor)
(when (funcall filter (car major) (car minor) (cdr minor))
minor))
(cdr major)))))
mailcap-mime-data))
(defun ensc/no-pdf-doc-view-filter (major minor spec)
(if (and (string= major "application")
(string= minor "pdf")
(member '(viewer . doc-view-mode) spec))
nil
t))
(eval-after-load 'mailcap
'(progn
(setq mailcap-mime-data
(ensc/mailcap-mime-data-filter 'ensc/no-pdf-doc-view-filter))))
;; TODO: and this seems to make xdg-open work, but breaks python interpreter
;; (setq process-connection-type nil)
;; highlight the parens ;; highlight the parens
(setq show-paren-delay 0) (setq show-paren-delay 0)