Skip to content

Commit 83fedf1

Browse files
committed
fix: recursive load errors on lib/projects.el
A change upstream was causing recursive load errors. I'm not too clear how it happens, as I can't reproduce it, but bbatsov/projectile@3c92d28c056c is the common thread (bumped in c1b5f48). Rather than revert the bump, I've just undone the hook and used a saner hook for the same task. It is a stopgap solution until I eventually replace projectile with project.el. Ref: bbatsov/projectile@3c92d28c056c Amend: c1b5f48
1 parent c1b5f48 commit 83fedf1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

lisp/doom-projects.el

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ Is nil if no executable is found in your PATH during startup.")
6868
(global-set-key [remap find-tag] #'projectile-find-tag)
6969

7070
:config
71-
;; HACK: Projectile cleans up the known projects list at startup. If this list
72-
;; contains tramp paths, the `file-remote-p' calls will pull in tramp via
73-
;; its `file-name-handler-alist' entry, which is expensive. Since Doom
74-
;; already cleans up the project list on kill-emacs-hook, it's simplest to
75-
;; inhibit this cleanup process at startup (see bbatsov/projectile#1649).
76-
(letf! ((#'projectile--cleanup-known-projects #'ignore))
77-
(projectile-mode +1))
7871
;; HACK: Auto-discovery and cleanup on `projectile-mode' is slow and
7972
;; premature. Let's try to defer it until it's needed.
8073
(add-transient-hook! 'projectile-relevant-known-projects
@@ -246,7 +239,18 @@ when using many of projectile's command, e.g. `projectile-compile-command',
246239
This suppresses the error so these commands will still run, but prompt you for
247240
the command instead."
248241
:around #'projectile-default-generic-command
249-
(ignore-errors (apply fn args))))
242+
(ignore-errors (apply fn args)))
243+
244+
;; HACK: Projectile cleans up the known projects list at startup. If this list
245+
;; contains tramp paths, the `file-remote-p' calls will pull in tramp via
246+
;; its `file-name-handler-alist' entry, which is expensive. Since Doom
247+
;; already cleans up the project list on kill-emacs-hook, it's simplest to
248+
;; inhibit this cleanup process at startup (see bbatsov/projectile#1649).
249+
(letf! ((#'projectile--cleanup-known-projects #'ignore))
250+
(projectile-mode +1)
251+
;; HACK: See bbatsov/projectile@3c92d28c056c
252+
(remove-hook 'buffer-list-update-hook #'projectile-track-known-projects-find-file-hook)
253+
(add-hook 'doom-switch-buffer-hook #'projectile-track-known-projects-find-file-hook t)))
250254

251255

252256
;;

0 commit comments

Comments
 (0)