diff options
author | bd <bdunahu@operationnull.com> | 2024-09-12 09:07:58 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-09-12 09:13:36 -0400 |
commit | 9f2a566fa39232d9bd8cbda60f5f4acb1992295e (patch) | |
tree | 548fca305d775c7f2cfd53c496a3467a31732ee4 /.config | |
parent | f67c2a3ae89f1e8733ccff18daa1572702a805f4 (diff) |
added smarter compile functions that look for a makefile
Diffstat (limited to '.config')
-rw-r--r-- | .config/emacs/modules/bd--devel.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/.config/emacs/modules/bd--devel.el b/.config/emacs/modules/bd--devel.el index caa8e0a..a37762d 100644 --- a/.config/emacs/modules/bd--devel.el +++ b/.config/emacs/modules/bd--devel.el @@ -32,11 +32,20 @@ to.") (concat "/sudo:root@localhost:" buffer-file-name)))) +(defun bd/compile-dwim (f) + (let ((default-directory + (or (locate-dominating-file "." "Makefile") + default-directory))) + (call-interactively f))) (setq compilation-always-kill t compilation-scroll-output 'first-error) -(keymap-set prog-mode-map "C-," #'recompile) -(keymap-set prog-mode-map "C-<" #'compile) +(keymap-set prog-mode-map "C-," #'(lambda () + (interactive) + (bd/compile-dwim #'recompile))) +(keymap-set prog-mode-map "C-<" #'(lambda () + (interactive) + (bd/compile-dwim #'compile))) (add-hook 'prog-mode-hook (lambda () (font-lock-add-keywords |