From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: emacs packages Date: Wed, 17 Jun 2015 14:42:50 -0400 Message-ID: <87ioamdvmd.fsf@netris.org> References: <87a8vzfwpr.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5IIg-00008K-S2 for guix-devel@gnu.org; Wed, 17 Jun 2015 14:43:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5IId-0008QE-Eb for guix-devel@gnu.org; Wed, 17 Jun 2015 14:43:02 -0400 In-Reply-To: (Federico Beffa's message of "Tue, 16 Jun 2015 21:31:20 +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@gnu.org, Alex Kost Federico Beffa writes: > What do you think about the attached implementation? [...] > +(define (emacs-byte-compile files) > + "Byte compile FILES, a list of file names." > + (if (pair? files) > + (for-each (lambda (f) > + (let ((expr `(let () > + (push ,(dirname f) load-path) > + (byte-compile-file ,f)))) > + (emacs-batch-eval expr))) > + files) > + (error "emacs-byte-compile failed: not a list of files!" files))) > + I would prefer to let an emacs expert (Alex?) comment on this, but here are some preliminary comments: * I wouldn't bother checking the type of 'files', since 'for-each' will do that. Also, () is a list but not a pair. * Maybe use 'progn' instead of 'let ()' ? * Instead of launching a separate emacs process for each file, how about passing the list of filenames into emacs and do the loop within emacs itself? Mark