diff --git a/lisp/doom-projects.el b/lisp/doom-projects.el index aa1d22987..51736a196 100644 --- a/lisp/doom-projects.el +++ b/lisp/doom-projects.el @@ -68,13 +68,6 @@ Is nil if no executable is found in your PATH during startup.") (global-set-key [remap find-tag] #'projectile-find-tag) :config - ;; 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 @@ -246,7 +239,18 @@ when using many of projectile's command, e.g. `projectile-compile-command', This suppresses the error so these commands will still run, but prompt you for the command instead." :around #'projectile-default-generic-command - (ignore-errors (apply fn args)))) + (ignore-errors (apply fn args))) + + ;; 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: See bbatsov/projectile@3c92d28c056c + (remove-hook 'buffer-list-update-hook #'projectile-track-known-projects-find-file-hook) + (add-hook 'doom-switch-buffer-hook #'projectile-track-known-projects-find-file-hook t))) ;;