use-package
use-package copied to clipboard
How can I properly defer pdf-tools?
Runtime Environment
- MX Linux 18
- GNU Emacs 27.0.50
- Evil version 1.2.14
- .emacs.d
- packages
- use-package: 20181119.2350
- pdf-tools: 20190129.1822
Issue
With the configuration,
(use-package pdf-tools
:defer t
:init
(add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode)))
I get the following error whenever I try to open a PDF file:
File mode specification error: (void-function pdf-view-mode)
If I remove the deferring it opens PDFs normally, but I get a huge loss in performance. Other modes work fine with deferring, what's going on here?
Please try :mode instead of :init.
(use-package pdf-tools
:mode ("\\.pdf\\'" . pdf-view-mode))
@conao3 answered this question, so I'm closing this issue now.