From e0dd62a10888976ee15922b34e42d92b22151a76 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 13 May 2024 09:54:13 +0100 Subject: [PATCH] Project config update Don't search for projects on package load as it slows down startup too much, wrap in interactive function to call as and when I want it Move package variable customisation into use-package block --- init.el | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/init.el b/init.el index 2522e96..855d211 100644 --- a/init.el +++ b/init.el @@ -135,7 +135,7 @@ :bind (("C-c b" . ibuffer))) (use-package ibuffer-project - :after ibuffer + :after (ibuffer project) :hook ((ibuffer . (lambda () (setq ibuffer-filter-groups (ibuffer-project-generate-filter-groups)) (unless (eq ibuffer-sorting-mode 'project-file-relative) @@ -948,19 +948,26 @@ :after flymake :hook (sh-mode . flymake-shellcheck-load)) -(setq project-switch-use-entire-map t - project-switch-commands '((project-find-file "Find file") - (project-find-regexp "Find regexp") - (project-find-dir "Find directory") - (project-eshell "Eshell") - (magit-project-status "Magit"))) - (use-package project + :custom + (project-switch-use-entire-map t) + (project-switch-commands '((project-find-file "Find file") + (project-find-regexp "Find regexp") + (project-find-dir "Find directory") + (project-eshell "Eshell") + (magit-project-status "Magit"))) :config - (if (file-exists-p "~/.config/") - (project-remember-projects-under "~/.config/" t)) - (if (file-exists-p "~/Projects/") - (project-remember-projects-under "~/Projects/" t)) + (defun my/project-find-common-projects () + "Search common project directories using +`project-remember-project-under'." + (interactive) + (require 'project) + (if (file-exists-p "~/.config/") + (project-remember-projects-under "~/.config/" t)) + (if (file-exists-p "~/Projects/") + (project-remember-projects-under "~/Projects/" t)) + (if (file-exists-p "~/Documents/") + (project-remember-projects-under "~/Documents/" t))) (project-forget-zombie-projects)) (use-package magit