From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: emacs packages Date: Tue, 16 Jun 2015 12:24:00 -0400 Message-ID: <87a8vzfwpr.fsf@netris.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4tet-0000ez-Li for guix-devel@gnu.org; Tue, 16 Jun 2015 12:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4ten-0002Vv-KI for guix-devel@gnu.org; Tue, 16 Jun 2015 12:24:19 -0400 Received: from world.peace.net ([50.252.239.5]:34365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4ten-0002Vp-Gp for guix-devel@gnu.org; Tue, 16 Jun 2015 12:24:13 -0400 In-Reply-To: (Federico Beffa's message of "Mon, 15 Jun 2015 12:20:56 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: Guix-devel Federico Beffa 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