Only make TAGS when TAGS target available
The "(Shell command failed with code 2 and no output)" was starting to drive me nuts. * .emacs.d/site-lisp/oni.el (oni:after-save-func): Check if there is a `TAGS:' target in the found makefile before trying to make.
This commit is contained in:
parent
c8b34bbdad
commit
19cc94fc81
1 changed files with 4 additions and 2 deletions
|
@ -68,8 +68,10 @@ DOT are intentionally being skipped."
|
||||||
"Function for `after-save-hook'."
|
"Function for `after-save-hook'."
|
||||||
(oni:compile-el)
|
(oni:compile-el)
|
||||||
(executable-make-buffer-file-executable-if-script-p)
|
(executable-make-buffer-file-executable-if-script-p)
|
||||||
(let ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile")))
|
(let* ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile"))
|
||||||
(when dom-dir
|
(TAGSp (not (string= "" (shell-command-to-string
|
||||||
|
(concat "grep \"^TAGS:\" " dom-dir "Makefile"))))))
|
||||||
|
(when (and dom-dir TAGSp)
|
||||||
(shell-command
|
(shell-command
|
||||||
(concat "make -C " dom-dir " TAGS >/dev/null 2>&1")))))
|
(concat "make -C " dom-dir " TAGS >/dev/null 2>&1")))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue