From 19cc94fc81a8b655c7104d1f058fa2ac1b0a52c4 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 19 Dec 2012 11:29:46 +0100 Subject: 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. --- .emacs.d/site-lisp/oni.el | 6 ++++-- 1 file 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"))))) -- cgit v1.2.3-54-g00ecf