mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
build: emacs-utils: Add 'emacs-byte-compile-directory'.
* guix/build/emacs-utils.scm (emacs-byte-compile-directory): New procedure.
This commit is contained in:
parent
7f74a931dd
commit
1d44b4e544
1 changed files with 11 additions and 0 deletions
|
@ -22,6 +22,7 @@ (define-module (guix build emacs-utils)
|
|||
emacs-batch-eval
|
||||
emacs-batch-edit-file
|
||||
emacs-generate-autoloads
|
||||
emacs-byte-compile-directory
|
||||
emacs-substitute-sexps
|
||||
emacs-substitute-variables))
|
||||
|
||||
|
@ -57,6 +58,16 @@ (define (emacs-generate-autoloads name directory)
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue