summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2015-06-16 21:09:57 +0200
committerFederico Beffa <beffa@fbengineering.ch>2015-07-08 10:53:05 +0200
commit1d44b4e544151f9911b3a19b522e5b9584ba7632 (patch)
treee612516444a7a52f94e55a132133046f154d897c
parent7f74a931ddccdb3b42558f8f8ee29b309d9231b9 (diff)
build: emacs-utils: Add 'emacs-byte-compile-directory'.
* guix/build/emacs-utils.scm (emacs-byte-compile-directory): New procedure.
-rw-r--r--guix/build/emacs-utils.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 0cff28b45b..fd06aad7ac 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -22,6 +22,7 @@
emacs-batch-eval
emacs-batch-edit-file
emacs-generate-autoloads
+ emacs-byte-compile-directory
emacs-substitute-sexps
emacs-substitute-variables))
@@ -57,6 +58,16 @@
(update-directory-autoloads ,directory))))
(emacs-batch-eval expr)))
+(define* (emacs-byte-compile-directory dir #:optional (dependency-dirs '()))
+ "Byte compile all files in DIR and its sub-directories. Before compiling
+the files, add DIR and all directories in DEPENDENCY-DIRS to 'load-path'."
+ (let ((expr `(progn
+ (add-to-list 'load-path ,dir)
+ (when ',dependency-dirs
+ (setq load-path (append ',dependency-dirs load-path)))
+ (byte-recompile-directory (file-name-as-directory ,dir) 0))))
+ (emacs-batch-eval expr)))
+
(define-syntax emacs-substitute-sexps
(syntax-rules ()
"Substitute the S-expression immediately following the first occurrence of