Federico Beffa <be...@ieee.org> writes:

> (define* (build #:key outputs inputs #:allow-other-keys)
>   "Compile .el files."
>   (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs"))
>          (out (assoc-ref outputs "out"))
>          (name-ver (store-dir->elpa-name-version out))
>          (el-dir (string-append out guix-elpa-packages-path "/" name-ver)))
>     (setenv "SHELL" "sh")
>     (with-directory-excursion el-dir
>       (fold (lambda (f s)
>               (and s (zero? (system* emacs "--batch" "-Q" "-L" el-dir
>                                      "-f" "batch-byte-compile" f))))
>             #t (find-files "." "\\.el$")))))

FYI, this pattern of using 'fold' with 'and' and a boolean seed would be
more transparent if handled by 'every' from (srfi srfi-1):

  (every (lambda (f)
           (zero? (system* emacs "--batch" "-Q" "-L" el-dir
                           "-f" "batch-byte-compile" f)))
         (find-files "." "\\.el$"))

However, this won't be needed here if you use 'emacs-batch-eval' or add
'emacs-byte-compile' as suggested by Ludovic, which I agree is the right
approach.

     Thanks!
       Mark

Reply via email to