Compile even if directory is not found
This commit is contained in:
parent
ad47f5df1f
commit
ebd40d8d8f
26
init.org
26
init.org
|
@ -2320,19 +2320,21 @@ _u_: next word ^_l_: edit lines^ _s_: next whole symbol
|
|||
(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."
|
||||
"Enter ancestor directory containing FILE and run compile command CMD.
|
||||
If CMD is not supplied, use `compile-command'.
|
||||
With PREFIX argument and omitted CMD, prompt for command."
|
||||
(interactive "fDominating File: \nP")
|
||||
(save-window-excursion
|
||||
(awhen (locate-dominating-file default-directory file)
|
||||
(cd it)
|
||||
(compile
|
||||
(cond (prefix
|
||||
(compilation-read-command
|
||||
(or cmd "")))
|
||||
(cmd cmd)
|
||||
(t compile-command))))))
|
||||
(awhen (locate-dominating-file default-directory file)
|
||||
(cd it))
|
||||
(compile
|
||||
(cond (prefix
|
||||
(compilation-read-command
|
||||
(or cmd "")))
|
||||
(cmd cmd)
|
||||
(t compile-command)))
|
||||
;; (select-window (split-window-below))
|
||||
;; (switch-to-buffer (compilation-find-buffer))
|
||||
(boon-mode))
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
|
Loading…
Reference in New Issue