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:
parent
7a344fbb5e
commit
937469509b
1 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue