Commit 4d379997f8e3

Vincent Demeester <vincent@sbr.pm>
2025-03-28 15:30:52
tools/emacs: remove project-try-local…
And use project-rootfile (testing it). It gets in the way of tabs, so removing it, I have other means to find things for the org and documents folders. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent e31b561
Changed files (1)
tools
tools/emacs/config/config-projects.el
@@ -22,10 +22,21 @@
          ("C-x p s" . vde-project-vterm)
          ("C-x p X" . vde-project-run-in-vterm)
 	 ("C-x p G" . checkout-github-pr))
+  :init
+  (require project-rootfile)
+  (add-to-list 'project-find-functions #'project-rootfile-try-detect t)
+  (setq project-rootfile-list '(".project"
+    "default.nix" "flake.nix"                               ; nix
+    "Makefile" "GNUMakefile" "CMakeLists.txt"               ; Make & CMake
+    "Cask" "Eldev" "Keg" "Eask"                             ; Emacs
+    "stack.yaml"                                            ; Haskell
+    "Cargo.toml"                                            ; Rust
+    "go.mod"                                                ; Go
+    ))
   :config
   (setq vde/project-local-identifier '(".project")) ;; "go.mod"
 
-  (add-hook 'project-find-functions #'vde/project-try-local)
+  ;; (add-hook 'project-find-functions #'vde/project-try-local)
 
   (setq-default project-compilation-buffer-name-function 'project-prefixed-buffer-name)
   (defun vde-project-magit-status ()
@@ -51,7 +62,6 @@ switch to it. Otherwise, create a new vterm shell."
       (when command
         (vterm-send-string command)
         (vterm-send-return))))
-  :config
   (general-leader
     "p"  '(:ignore :which-key "Project")
     "pp"  #'(project-switch-project :which-key "Switch to Project")