emacs-evil / evil-collection

A set of keybindings for evil-mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evil Collection triggers loading of `pdf-tools` twice

SPFabGerman opened this issue · comments

I noticed a small bug when using pdf-tools in combination with evil-collection.
Using the following code in my init file (with pdf-tools already installed):

(use-package evil-collection
  :after evil
  :config
  (evil-collection-init))

(pdf-loader-install)
(with-eval-after-load 'pdf-view
    (message "LOADED pdf-view!"))
(with-eval-after-load 'pdf-tools
    (message "LOADED pdf-tools!")
    ;; (debug)
    )

I can see in the message buffer, that the pdf-tools code is loaded twice:

LOADED pdf-tools!
LOADED pdf-view!
LOADED pdf-tools!

Using the debugger I figured out that the first (unintended) load happens when loading pdf-view and seems to be caused by evil-collection-require:
Screenshot-2023-09-03-20:29:03

Here is also the debugger of the second (intended) load:
Screenshot-2023-09-03-20:29:24

Removing the evil-collection code from my init file fixes this bug and the pdf-tools code is only loaded once, after pdf-view:

LOADED pdf-view!
LOADED pdf-tools!