evil-collection icon indicating copy to clipboard operation
evil-collection copied to clipboard

Evil Collection triggers loading of `pdf-tools` twice

Open SPFabGerman opened this issue 1 year ago • 0 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!

SPFabGerman avatar Sep 03 '23 18:09 SPFabGerman