diff --git a/lisp/doom-projects.el b/lisp/doom-projects.el index 462ccc863..d7bc9840a 100644 --- a/lisp/doom-projects.el +++ b/lisp/doom-projects.el @@ -44,13 +44,19 @@ debian, and derivatives). On most it's 'fd'.") (global-set-key [remap find-tag] #'projectile-find-tag) :config - (projectile-mode +1) - - ;; Auto-discovery on `projectile-mode' is slow and premature. Let's defer it - ;; until it's actually needed. Also clean up non-existing projects too! + ;; HACK: Projectile cleans up the known projects list at startup. If this list + ;; contains tramp paths, the `file-remote-p' calls will pull in tramp via + ;; its `file-name-handler-alist' entry, which is expensive. Since Doom + ;; already cleans up the project list on kill-emacs-hook, it's simplest to + ;; inhibit this cleanup process at startup (see bbatsov/projectile#1649). + (letf! ((#'projectile--cleanup-known-projects #'ignore)) + (projectile-mode +1)) + ;; HACK: Auto-discovery and cleanup on `projectile-mode' is slow and + ;; premature. Let's try to defer it until it's needed. (add-transient-hook! 'projectile-relevant-known-projects - (projectile-cleanup-known-projects) - (projectile-discover-projects-in-search-path)) + (projectile--cleanup-known-projects) + (when projectile-auto-discover + (projectile-discover-projects-in-search-path))) ;; Projectile runs four functions to determine the root (in this order): ;;