Add non-vc backed project backend

This commit is contained in:
Alexander Rosenberg 2023-11-02 21:38:31 -07:00
parent 21df11c7c2
commit d39d3b2d41
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

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