diff --git a/init.el b/init.el index b92b9d3..7afc018 100644 --- a/init.el +++ b/init.el @@ -527,6 +527,8 @@ visual states." (stringp val))) (defvar my/-project-run-history '() "Commands previously run with `my/project-run'") + (defvar my/project-root-marker ".project-root" + "Marker file to look for in non-vc backed projects.") (defun my/project-get-root-dir () "Get the root dir for the current project" (let* ((proj (project-current nil)) @@ -559,7 +561,12 @@ COMMAND and COMINT are like `compile'." (compile-command nil)) (compile command comint) (when (not my/project-run-command) - (setq my/project-run-command command))))) + (setq my/project-run-command command)))) + :config + (defun my/project-try-dotfile (dir) + (if-let (root (locate-dominating-file dir my/project-root-marker)) + (list 'vc nil root))) + (add-hook 'project-find-functions #'my/project-try-dotfile)) ;; nxml (use-package nxml-mode