Skip to content

Commit cbb4b17

Browse files
sunlin7bcc32
andauthored
[core] Load the projects list without activating the projectile-mode (#17006)
* [core] Load the projects without active projectile-mode * [core] Avoid byte-compilation warning about unknown function --------- Co-authored-by: Aaron L. Zeng <[email protected]>
1 parent 59c6fc0 commit cbb4b17

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/core-spacemacs-buffer.el

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,9 +1277,10 @@ LIST: list of `org-agenda' entries in the todo list."
12771277
(when (string-prefix-p (car x) (expand-file-name recent-file))
12781278
(setcdr x (cons (string-remove-prefix (car x) recent-file) (cdr x))))))
12791279

1280+
(autoload 'projectile-known-projects "projectile")
12801281
(defun spacemacs-buffer//recent-files-by-project ()
12811282
(let ((by-project (mapcar (lambda (p) (cons (expand-file-name p) nil))
1282-
(projectile-relevant-known-projects))))
1283+
(projectile-known-projects))))
12831284
(dolist (recent-file recentf-list by-project)
12841285
(spacemacs-buffer//associate-to-project recent-file by-project))))
12851286

@@ -1366,7 +1367,6 @@ startup list.")
13661367

13671368
(defun spacemacs-buffer//insert-recent-files-by-project (list-size)
13681369
(unless recentf-mode (recentf-mode))
1369-
(unless projectile-mode (projectile-mode))
13701370
(when (spacemacs-buffer//insert-files-by-dir-list
13711371
(spacemacs-buffer||propertize-heading
13721372
(spacemacs-buffer//font-icons-icon "" 'rocket)
@@ -1416,12 +1416,11 @@ startup list.")
14161416
(insert spacemacs-buffer-list-separator)))
14171417

14181418
(defun spacemacs-buffer//insert-projects (list-size)
1419-
(unless projectile-mode (projectile-mode))
14201419
(when (spacemacs-buffer//insert-file-list
14211420
(spacemacs-buffer||propertize-heading
14221421
(spacemacs-buffer//font-icons-icon "" 'rocket)
14231422
"Projects:" "p")
1424-
(spacemacs//subseq (projectile-relevant-known-projects)
1423+
(spacemacs//subseq (projectile-known-projects)
14251424
0 list-size))
14261425
(spacemacs-buffer||add-shortcut "p" "Projects:")
14271426
(insert spacemacs-buffer-list-separator)))

0 commit comments

Comments
 (0)