build-cmd: add support for function symbols

This commit is contained in:
Henrik Lissner 2016-02-16 07:23:47 -05:00
parent 7236d623e5
commit 114afeb568

View file

@ -22,8 +22,10 @@ If ARG is nil this function calls `recompile', otherwise it calls
(let ((build-file (cdr narf--build-command))
(build-cmd (car narf--build-command)))
(if (or (null build-file) (narf/project-has-files build-file))
(compile (format "cd '%s' && %s" (narf/project-root) (format build-cmd (or arg ""))))
(error "Could not find Makefile"))))
(if (symbolp build-cmd)
(call-interactively build-cmd)
(compile (format "cd '%s' && %s" (narf/project-root) (format build-cmd (or arg "")))))
(error "Could not build!"))))
;;;; Code running ;;;;;;;;;;;;;;;;;;;;;;
;;;###autoload (autoload 'narf:eval-buffer "defuns-quickrun" nil t)