[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs packages
From: |
Alex Kost |
Subject: |
Re: emacs packages |
Date: |
Wed, 17 Jun 2015 23:00:23 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Mark H Weaver (2015-06-17 21:42 +0300) wrote:
> Federico Beffa <address@hidden> 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
(I don't consider myself an expert, I'm definitely much less experienced
with Emacs than you or Ludovic.)
> 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?
I totally agree with these comments. However since the goal is to
compile all elisp files in some directory, perhaps we may just use
'byte-recompile-directory' instead of looping 'byte-compile-file'.
Also I think there is a problem. An emacs package can require other
packages, so for a successful compiling, 'load-path' should be augmented
not only with the directory of the original package, but with the
directories of the required packages as well.
--
Alex
- Re: emacs packages, (continued)
- Re: emacs packages, Ludovic Courtès, 2015/06/19
- Re: emacs packages, Federico Beffa, 2015/06/19
- Re: emacs packages, Ludovic Courtès, 2015/06/21
- Re: emacs packages, Federico Beffa, 2015/06/22
- Re: emacs packages, Ludovic Courtès, 2015/06/22
- Re: emacs packages, Federico Beffa, 2015/06/23
- Re: emacs packages, Ludovic Courtès, 2015/06/23
Re: emacs packages, Mark H Weaver, 2015/06/16