diff options
author | Kenny Ballou <kb@devnulllabs.io> | 2022-11-02 13:04:20 -0600 |
---|---|---|
committer | Kenny Ballou <kb@devnulllabs.io> | 2022-11-02 13:04:20 -0600 |
commit | 3aeaf3ff178ab719c5390bb213fbc20ad0e2be1e (patch) | |
tree | 97de89e1a7cc38386a11782f50d240b1868bff0d /config | |
parent | df8235356d6d0f201aea9c9892e2662676e65d59 (diff) | |
download | dotfiles-3aeaf3ff178ab719c5390bb213fbc20ad0e2be1e.tar.gz dotfiles-3aeaf3ff178ab719c5390bb213fbc20ad0e2be1e.tar.xz |
config: emacs: add project.el configuration
Signed-off-by: Kenny Ballou <kb@devnulllabs.io>
Diffstat (limited to 'config')
-rw-r--r-- | config/emacs/emacs.d/emacs.org | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/config/emacs/emacs.d/emacs.org b/config/emacs/emacs.d/emacs.org index 696ef049..6131f4f1 100644 --- a/config/emacs/emacs.d/emacs.org +++ b/config/emacs/emacs.d/emacs.org @@ -1701,6 +1701,34 @@ https://matthewbauer.us/blog/bauer.html :after perspective) #+end_src +*** Project.el +:PROPERTIES: +:ID: a26fa6d9-d2f8-430b-9d4b-f9a41d8ae0f1 +:END: + +#+begin_src elisp +(defun project-root-override (dir) + "Find DIR's project root by searching for a '.project.el' file. + +If this file exists, it marks the project root. For convenient +compatibility with Projectile, '.projectile' is also considered a project root marker. + +https://blog.jmthornton.net/p/emacs-project-override" + (let ((root (or (locate-dominating-file dir ".project.el") + (locate-dominating-file dir ".projectile"))) + (backend (ignore-errors (vc-responsible-backend dir)))) + (when root (if (version<= emacs-version "28") + (cons 'vc root) + (list 'vc backend root))))) +#+end_src + +#+begin_src elisp +(use-package project + :config + (setq project-compilation-buffer-name-function #'project-prefixed-buffer-name) + (add-hook 'project-find-functions #'project-root-override)) +#+end_src + *** Grand Unified Debugger :PROPERTIES: :ID: f71600a2-9e68-4450-9f38-180d1138274a |