Commit 31e98786ae78

Vincent Demeester <vincent@sbr.pm>
2026-01-28 09:50:39
feat(emacs): add dynamic project list discovery
- Add vde/project-refresh-list command (C-x p R) to rescan ~/src - Auto-populate project list on first run if empty - Add project-list-exclude patterns to filter build directories - Comment out project-vc-extra-root-markers to avoid nested project detection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f98e8e1
Changed files (1)
dots
.config
emacs
dots/.config/emacs/init.el
@@ -845,14 +845,27 @@ minibuffer, even without explicitly focusing it."
 			     (?g "Checkout GitHub PR" checkout-github-pr)))
   (project-mode-line t)
   (project-compilation-buffer-name-function 'project-prefixed-buffer-name)
-  (project-vc-extra-root-markers '(".project" "Cargo.toml" "pyproject.toml" "requirements.txt" "go.mod"))
+  ;; (project-vc-extra-root-markers '(".project" "Cargo.toml" "pyproject.toml" "requirements.txt" "go.mod"))
+  (project-list-exclude '("/build\\(/\\|\\'\\)" "/node_modules\\(/\\|\\'\\)" "/.cache\\(/\\|\\'\\)" "/target\\(/\\|\\'\\)" "/.direnv\\(/\\|\\'\\)"))
   :bind
   ("C-x p v" . vde/project-magit-status)
   ("C-x p s" . vde/project-vterm)
   ("C-x p X" . vde/project-run-in-vterm)
   ("C-x p E" . vde/project-eat)
   ("C-x p G" . checkout-github-pr)
-  ("C-x p F" . flymake-show-project-diagnostics))
+  ("C-x p F" . flymake-show-project-diagnostics)
+  ("C-x p R" . vde/project-refresh-list)
+  :config
+  (defun vde/project-refresh-list ()
+    "Rescan ~/src for projects."
+    (interactive)
+    (project-forget-zombie-projects)
+    (project-remember-projects-under "~/src" t)
+    (message "Project list refreshed"))
+
+  ;; Populate project list on first run if empty
+  (unless project--list
+    (project-remember-projects-under "~/src" t)))
 
 (use-package eshell
   :commands (eshell eshell-here)