Load the pdf-tools modules lazily by means of pdf-loader-install

This commit is contained in:
Gerard Vermeulen 2021-12-12 16:24:32 +01:00
parent 7a54e7d90b
commit 5579eb585c
1 changed files with 5 additions and 4 deletions

View File

@ -590,11 +590,12 @@ installation of [[https://github.com/vedang/pdf-tools][pdf-tools]] from [[https:
rebuild the =epdfinfo= executable that serves the [[https://en.wikipedia.org/wiki/PDF][PDF]] files to Emacs.
#+begin_src emacs-lisp
(when (fboundp 'pdf-tools-install)
(autoload 'pdf-view-mode "pdf-view")
(add-to-list 'magic-mode-alist '("%PDF" . pdf-view-mode)))
;; 'pdf-loader-install' is the lazy equivalent of 'pdf-tools-install':
;; see the README file.
(when (fboundp 'pdf-loader-install)
(pdf-loader-install))
(with-eval-after-load 'pdf-tools
(with-eval-after-load 'pdf-view
(when (fboundp 'pdf-view-restore-mode)
(add-hook 'pdf-view-mode-hook #'pdf-view-restore-mode)))
#+end_src