Cleanup how my/project-find-common-projects works

Use dolist to remove unnecessary duplication

Add ~/Documents/ directory to list searched
This commit is contained in:
Evie Litherland-Smith 2024-05-13 10:04:56 +01:00
parent e0dd62a108
commit 05ef93948f

19
init.el
View file

@ -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)