diff options
| author | Federico Beffa <beffa@fbengineering.ch> | 2015-06-16 21:09:57 +0200 |
|---|---|---|
| committer | Federico Beffa <beffa@fbengineering.ch> | 2015-07-08 10:53:05 +0200 |
| commit | 1d44b4e544151f9911b3a19b522e5b9584ba7632 (patch) | |
| tree | e612516444a7a52f94e55a132133046f154d897c | |
| parent | 7f74a931ddccdb3b42558f8f8ee29b309d9231b9 (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.scm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index 0cff28b45b4..fd06aad7ac7 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | emacs-batch-eval | 22 | emacs-batch-eval |
| 23 | emacs-batch-edit-file | 23 | emacs-batch-edit-file |
| 24 | emacs-generate-autoloads | 24 | emacs-generate-autoloads |
| 25 | emacs-byte-compile-directory | ||
| 25 | emacs-substitute-sexps | 26 | emacs-substitute-sexps |
| 26 | emacs-substitute-variables)) | 27 | emacs-substitute-variables)) |
| 27 | 28 | ||
| @@ -57,6 +58,16 @@ | |||
| 57 | (update-directory-autoloads ,directory)))) | 58 | (update-directory-autoloads ,directory)))) |
| 58 | (emacs-batch-eval expr))) | 59 | (emacs-batch-eval expr))) |
| 59 | 60 | ||
| 61 | (define* (emacs-byte-compile-directory dir #:optional (dependency-dirs '())) | ||
| 62 | "Byte compile all files in DIR and its sub-directories. Before compiling | ||
| 63 | the files, add DIR and all directories in DEPENDENCY-DIRS to 'load-path'." | ||
| 64 | (let ((expr `(progn | ||
| 65 | (add-to-list 'load-path ,dir) | ||
| 66 | (when ',dependency-dirs | ||
| 67 | (setq load-path (append ',dependency-dirs load-path))) | ||
| 68 | (byte-recompile-directory (file-name-as-directory ,dir) 0)))) | ||
| 69 | (emacs-batch-eval expr))) | ||
| 70 | |||
| 60 | (define-syntax emacs-substitute-sexps | 71 | (define-syntax emacs-substitute-sexps |
| 61 | (syntax-rules () | 72 | (syntax-rules () |
| 62 | "Substitute the S-expression immediately following the first occurrence of | 73 | "Substitute the S-expression immediately following the first occurrence of |
