[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] build: emacs-utils: Add 'emacs-byte-compile-directory'
From: |
Federico Beffa |
Subject: |
Re: [PATCH 2/5] build: emacs-utils: Add 'emacs-byte-compile-directory' |
Date: |
Wed, 24 Jun 2015 18:13:56 +0200 |
Thanks.
On Sun, Jun 21, 2015 at 10:40 PM, Alex Kost <address@hidden> wrote:
> Federico Beffa (2015-06-21 11:29 +0300) wrote:
>
> [...]
>> +(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)
>> + (unless (null ,(if (null? dependency-dirs)
>> + 'nil
>> + dependency-dirs))
>> + (setq load-path (append load-path ,dependency-dirs)))
>> + (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
>
> Shouldn't there be problems with unquoted 'dependency-dirs' list? IIUC
> the following:
>
> (emacs-byte-compile-directory "/tmp/foo" '("one" "two"))
>
> will produce the following elisp expression:
>
> (progn
> (add-to-list (quote load-path) "/tmp/foo")
> (unless (null ("one" "two"))
> (setq load-path (append load-path ("one" "two"))))
> (byte-recompile-directory (file-name-as-directory "/tmp/foo") 0))
>
> but that will raise an error ‘(invalid-function "one")’. Or did I miss
> anything?
>
> Also I believe dependency-dirs should have a preference over other
> 'load-path' directories.
>
> So what about the following variant:
>
>
>
> --
> Alex
>
0002-build-emacs-utils-Add-emacs-byte-compile-directory.patch
Description: Text Data