 (dolist (mode evil-collection-mode-list)
   (dolist (req (or (cdr-safe mode) (list mode)))
     (with-eval-after-load req
-      (+evil-collection-init mode))))
+      (+evil-collection-init mode +evil-collection-disabled-list))))

;; These modes belong to packages that Emacs always loads at startup, causing
;; evil-collection to load immediately. We avoid this by loading them after
;; evil-collection has first loaded...
(after! evil-collection
  (let (+evil-collection-disabled-list)
    (mapc #'+evil-collection-init '(comint custom help))))

;; ...or on first invokation of their associated major/minor modes.
(add-transient-hook! 'Buffer-menu-mode

    youtube-dl
    (ztree ztree-diff)))

(defun +evil-collection-init (module &optional disabled-list)
  "Initialize evil-collection-MODULE.

Unlike `evil-collection-init', this respects `+evil-collection-disabled-list',
and complains if a module is loaded too early (during startup)."
  (unless (memq (or (car-safe module) module) disabled-list)
    (doom-log "Initialized evil-collection-%s %s"
              (or (car-safe module) module)
              (if doom-init-time "" "(too early!)"))
    (with-demoted-errors "evil-collection error: %s"
      (evil-collection-init (list module)))))

