bump: projectile

bbatsov/projectile@0a15d81be9 -> bbatsov/projectile@55db082cdf

Fix: #8288
This commit is contained in:
StrawberryTea
2025-03-21 22:29:13 -04:00
committed by GitHub
parent 466490c252
commit 32368d0e94
2 changed files with 4 additions and 50 deletions

View File

@ -2,16 +2,6 @@
;;; Commentary: ;;; Commentary:
;;; Code: ;;; Code:
(defvar doom-projectile-cache-limit 10000
"If any project cache surpasses this many files it is purged when quitting
Emacs.")
(defvar doom-projectile-cache-blacklist '("~" "/tmp" "/")
"Directories that should never be cached.")
(defvar doom-projectile-cache-purge-non-projects nil
"If non-nil, non-projects are purged from the cache on `kill-emacs-hook'.")
(define-obsolete-variable-alias 'doom-projectile-fd-binary 'doom-fd-executable "3.0.0") (define-obsolete-variable-alias 'doom-projectile-fd-binary 'doom-fd-executable "3.0.0")
(defvar doom-fd-executable (cl-find-if #'executable-find (list "fdfind" "fd")) (defvar doom-fd-executable (cl-find-if #'executable-find (list "fdfind" "fd"))
"The filename of the fd executable. "The filename of the fd executable.
@ -51,16 +41,15 @@ Is nil if no executable is found in your PATH during startup.")
projectile-locate-dominating-file projectile-locate-dominating-file
projectile-relevant-known-projects) projectile-relevant-known-projects)
:init :init
(setq projectile-cache-file (concat doom-cache-dir "projectile.cache") (setq ;; Auto-discovery is slow to do by default. Better to update the list
;; Auto-discovery is slow to do by default. Better to update the list
;; when you need to (`projectile-discover-projects-in-search-path'). ;; when you need to (`projectile-discover-projects-in-search-path').
projectile-auto-discover nil projectile-auto-discover nil
projectile-enable-caching (not noninteractive) projectile-enable-caching (if noninteractive t 'persistent)
projectile-globally-ignored-files '(".DS_Store" "TAGS") projectile-globally-ignored-files '(".DS_Store" "TAGS")
projectile-globally-ignored-file-suffixes '(".elc" ".pyc" ".o") projectile-globally-ignored-file-suffixes '(".elc" ".pyc" ".o")
projectile-kill-buffers-filter 'kill-only-files projectile-kill-buffers-filter 'kill-only-files
projectile-known-projects-file (concat doom-cache-dir "projectile.projects")
projectile-ignored-projects '("~/") projectile-ignored-projects '("~/")
projectile-known-projects-file (concat doom-cache-dir "projectile-projects.eld")
projectile-ignored-project-function #'doom-project-ignored-p projectile-ignored-project-function #'doom-project-ignored-p
projectile-fd-executable doom-fd-executable) projectile-fd-executable doom-fd-executable)
@ -121,40 +110,6 @@ Is nil if no executable is found in your PATH during startup.")
(put 'projectile-ripgrep 'disabled "Use +default/search-project instead") (put 'projectile-ripgrep 'disabled "Use +default/search-project instead")
(put 'projectile-grep 'disabled "Use +default/search-project instead") (put 'projectile-grep 'disabled "Use +default/search-project instead")
;; Accidentally indexing big directories like $HOME or / will massively bloat
;; projectile's cache (into the hundreds of MBs). This purges those entries
;; when exiting Emacs to prevent slowdowns/freezing when cache files are
;; loaded or written to.
(add-hook! 'kill-emacs-hook
(defun doom-cleanup-project-cache-h ()
"Purge projectile cache entries that:
a) have too many files (see `doom-projectile-cache-limit'),
b) represent blacklisted directories that are too big, change too often or are
private. (see `doom-projectile-cache-blacklist'),
c) are not valid projectile projects."
(when (and (bound-and-true-p projectile-projects-cache)
projectile-enable-caching)
(setq projectile-known-projects
(cl-remove-if #'projectile-ignored-project-p
projectile-known-projects))
(projectile-cleanup-known-projects)
(cl-loop with blacklist = (mapcar #'file-truename doom-projectile-cache-blacklist)
for proot in (hash-table-keys projectile-projects-cache)
if (or (not (stringp proot))
(string-empty-p proot)
(>= (length (gethash proot projectile-projects-cache))
doom-projectile-cache-limit)
(member (substring proot 0 -1) blacklist)
(and doom-projectile-cache-purge-non-projects
(not (doom-project-p proot)))
(projectile-ignored-project-p proot))
do (doom-log "Removed %S from projectile cache" proot)
and do (remhash proot projectile-projects-cache)
and do (remhash proot projectile-projects-cache-time)
and do (remhash proot projectile-project-type-cache))
(projectile-serialize-cache))))
;; HACK: Some MSYS utilities auto expanded the `/' path separator, so we need ;; HACK: Some MSYS utilities auto expanded the `/' path separator, so we need
;; to prevent it. ;; to prevent it.
(when doom--system-windows-p (when doom--system-windows-p
@ -251,7 +206,6 @@ the command instead."
(add-hook! 'dired-after-readin-hook (add-hook! 'dired-after-readin-hook
(defun doom-project-track-known-project-h () (defun doom-project-track-known-project-h ()
(when projectile-mode (when projectile-mode
(setq projectile-project-root-cache (make-hash-table :test 'equal))
(projectile-track-known-projects-find-file-hook)))))) (projectile-track-known-projects-find-file-hook))))))

View File

@ -34,7 +34,7 @@
(package! ws-butler :pin "e3a38d93e01014cd47bf5af4924459bd145fd7c4") (package! ws-butler :pin "e3a38d93e01014cd47bf5af4924459bd145fd7c4")
;; doom-projects.el ;; doom-projects.el
(package! projectile :pin "0a15d81be953150399170f4b8e53b86ee96ad639") (package! projectile :pin "55db082cdf7b849335ccf24b7ba5aa2607d6fe93")
(package! project :pin "2a3fe4c7dbb6cf4d449c4d358ec9aaf8658f6940") (package! project :pin "2a3fe4c7dbb6cf4d449c4d358ec9aaf8658f6940")
;; doom-keybinds.el ;; doom-keybinds.el