From 05ef93948fdcafaacfd738b7e5b837d990eca953 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 13 May 2024 10:04:56 +0100 Subject: [PATCH] Cleanup how my/project-find-common-projects works Use dolist to remove unnecessary duplication Add ~/Documents/ directory to list searched --- init.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/init.el b/init.el index 855d211..e31f7f3 100644 --- a/init.el +++ b/init.el @@ -958,17 +958,18 @@ (magit-project-status "Magit"))) :config (defun my/project-find-common-projects () - "Search common project directories using -`project-remember-project-under'." + "Search and remember common project directories. + +Calls `project-remember-project-under' for ~/.config/, +~/Projects/, and ~/Documents/" (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)) + (project-forget-zombie-projects) + (dolist + (dir + '("~/.config/" "~/Projects/" "~/Documents/")) + (project-remember-projects-under dir t)) + )) (use-package magit :bind (("C-c g g" . magit-status)