[compile] move my-compile-project and update behavior
This commit is contained in:
parent
191eb0e5f5
commit
93d1433333
22
init.org
22
init.org
|
@ -1534,6 +1534,23 @@ _u_: next word ^_l_: edit lines^ _s_: next whole symbol
|
|||
("h" find-grep "find-grep"))
|
||||
#+END_SRC
|
||||
*** General
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(require 'anaphora)
|
||||
|
||||
(defun my-compile-project (file &optional prefix cmd)
|
||||
"Switch to ancestor directory with FILE and run compile command CMD.
|
||||
If CMD is not supplied, run `compile-command'.
|
||||
With PREFIX argument and CMD not supplied - prompt for command."
|
||||
(interactive "fDominating File: \nP")
|
||||
(save-excursion
|
||||
(awhen (locate-dominating-file default-directory file)
|
||||
(cd it)
|
||||
(compile
|
||||
(cond (cmd cmd)
|
||||
(prefix (compilation-read-command cmd))
|
||||
(t compile-command))))))
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(my-defhydra contrapunctus-general-hydra (:color blue)
|
||||
"What command?"
|
||||
|
@ -2964,11 +2981,6 @@ pjb suggested a different approach [[http://paste.lisp.org/display/10157][here]]
|
|||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun my-compile-project (file cmd)
|
||||
"Locate directory with FILE and run compile command CMD."
|
||||
(cd (locate-dominating-file default-directory file))
|
||||
(compile (compilation-read-command cmd)))
|
||||
|
||||
#+END_SRC
|
||||
|
||||
**** smartparens
|
||||
|
|
Loading…
Reference in New Issue