feat(tazjin/emacs): Add depot-aware project.el extension

If this ends up working well I'll extract it to tvl.el

Change-Id: I83722abf33a3346ccc7957c8d64d6381b15c6ee9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1837
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
This commit is contained in:
Vincent Ambo 2020-08-23 22:39:42 +01:00 committed by tazjin
parent 7a344fbb5e
commit 937469509b

View file

@ -40,8 +40,6 @@
(interactive)
(man "configuration.nix"))
;; Open my monorepo in magit
;; Get the nix store path for a given derivation.
;; If the derivation has not been built before, this will trigger a build.
(defun nix-store-path (derivation)
@ -281,4 +279,14 @@
(interactive)
(vterm-send-key "x" nil nil t))
(defun find-depot-project (dir)
"Function used in the `project-find-functions' hook list to
determine the current project root of a depot project."
(when (s-starts-with? "/depot" dir)
(if (f-exists-p (f-join dir "default.nix"))
(cons 'transient dir)
(find-depot-project (f-parent dir)))))
(add-to-list 'project-find-functions #'find-depot-project)
(provide 'functions)