From a82f8d8f4b2a1eb3053045ccea28dbcf9127dbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Wed, 5 Jun 2013 15:28:26 +0100 Subject: [PATCH] Add ability to have a func return a compile string Sometimes you want something fancier that a simple string for your make invocations. This way you can define a function in your :common-compiles list which can return a string or nil. The function is passed the eproject-root. Any nils are removed from the final list passed back to the compile history. --- contrib/eproject-compile.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/eproject-compile.el b/contrib/eproject-compile.el index 9dceb81..f421665 100644 --- a/contrib/eproject-compile.el +++ b/contrib/eproject-compile.el @@ -51,10 +51,13 @@ (let ((potential-compiles (eproject-attribute :common-compiles)) (new-compile-history (list ()))) (if potential-compiles - (mapcar - '(lambda (c) - (format "cd %s && %s" (eproject-root) c)) - potential-compiles) + (delq 'nil (mapcar + '(lambda (c) + (cond + ((functionp c) (funcall c (eproject-root))) + ((stringp c) (format "cd %s && %s" (eproject-root) c)) + (t 'nil))) + potential-compiles)) (list (format "cd %s && make -k" (eproject-root))))))) ;;;###autoload