Add my/project-compile-or-default
This commit is contained in:
parent
1580c691e4
commit
c6c7468eb9
7
init.el
7
init.el
@ -706,6 +706,7 @@ to `posframe-show' if the display is graphical."
|
|||||||
;; project.el
|
;; project.el
|
||||||
(use-package project
|
(use-package project
|
||||||
:bind (("C-c v" . my/project-eshell-or-default)
|
:bind (("C-c v" . my/project-eshell-or-default)
|
||||||
|
([remap project-compile] . my/project-compile-or-default)
|
||||||
:map project-prefix-map
|
:map project-prefix-map
|
||||||
("s" . my/project-eshell)
|
("s" . my/project-eshell)
|
||||||
("u" . my/project-run))
|
("u" . my/project-run))
|
||||||
@ -724,6 +725,12 @@ to `posframe-show' if the display is graphical."
|
|||||||
(interactive "P")
|
(interactive "P")
|
||||||
(unless (my/project-eshell nil arg)
|
(unless (my/project-eshell nil arg)
|
||||||
(eshell arg)))
|
(eshell arg)))
|
||||||
|
(defun my/project-compile-or-default ()
|
||||||
|
"If in a project, run `project-compile', otherwise run `compile'."
|
||||||
|
(interactive)
|
||||||
|
(if (project-current)
|
||||||
|
(call-interactively 'project-compile)
|
||||||
|
(call-interactively 'compile)))
|
||||||
(defvar my/project-run-command nil
|
(defvar my/project-run-command nil
|
||||||
"Command to run with `my/project-run'.")
|
"Command to run with `my/project-run'.")
|
||||||
(put 'my/project-run-command 'safe-local-variable (lambda (val)
|
(put 'my/project-run-command 'safe-local-variable (lambda (val)
|
||||||
|
Loading…
Reference in New Issue
Block a user