summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-12-19 11:29:46 +0100
committerGravatar Tom Willemsen2012-12-19 11:29:46 +0100
commit19cc94fc81a8b655c7104d1f058fa2ac1b0a52c4 (patch)
tree66b70402d3edceba647d7f31c615d46bc7c7ec51
parentc8b34bbdad15a4153f87d4b6df324fe34b1c8a37 (diff)
downloaddotfiles-19cc94fc81a8b655c7104d1f058fa2ac1b0a52c4.tar.gz
dotfiles-19cc94fc81a8b655c7104d1f058fa2ac1b0a52c4.zip
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.
-rw-r--r--.emacs.d/site-lisp/oni.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el
index 8930d6d..46c87fb 100644
--- a/.emacs.d/site-lisp/oni.el
+++ b/.emacs.d/site-lisp/oni.el
@@ -68,8 +68,10 @@ DOT are intentionally being skipped."
"Function for `after-save-hook'."
(oni:compile-el)
(executable-make-buffer-file-executable-if-script-p)
- (let ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile")))
- (when dom-dir
+ (let* ((dom-dir (locate-dominating-file (buffer-file-name) "Makefile"))
+ (TAGSp (not (string= "" (shell-command-to-string
+ (concat "grep \"^TAGS:\" " dom-dir "Makefile"))))))
+ (when (and dom-dir TAGSp)
(shell-command
(concat "make -C " dom-dir " TAGS >/dev/null 2>&1")))))