Re: [PATCH] port elisp-compilation support to emacs-23.1 and newer

2017-12-11 Thread Jim Meyering
On Mon, Dec 11, 2017 at 9:56 AM, Glenn Morris  wrote:
>
> Jim Meyering wrote (on Sun, 10 Dec 2017 at 17:01 -0800):
>
>> However, I don't see how "-f batch-byte-compile" can be used when
>> the .elc file must be created in a directory separate from the one
>> containing the .el file.
>
> I meant, instead of reinventing the wheel with this part:
>
>  --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"
>
> Example:
>
> mkdir /tmp/foo /tmp/bar
> echo '(message "hi")' > /tmp/foo/foo.el
> emacs --batch \
>  --eval '(setq byte-compile-dest-file-function (lambda (x) 
> "/tmp/bar/foo.elc"))' \
>  -f batch-byte-compile /tmp/foo/foo.el
>
> -> generates /tmp/bar/foo.elc
>
> batch-byte-compile exists since forever.

Thank you. That looks better, indeed. I will see if I can adapt the
automake patch accordingly.



Re: [PATCH] port elisp-compilation support to emacs-23.1 and newer

2017-12-11 Thread Glenn Morris

Jim Meyering wrote (on Sun, 10 Dec 2017 at 17:01 -0800):

> However, I don't see how "-f batch-byte-compile" can be used when
> the .elc file must be created in a directory separate from the one
> containing the .el file.

I meant, instead of reinventing the wheel with this part:

 --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"

Example:

mkdir /tmp/foo /tmp/bar
echo '(message "hi")' > /tmp/foo/foo.el
emacs --batch \
 --eval '(setq byte-compile-dest-file-function (lambda (x) 
"/tmp/bar/foo.elc"))' \
 -f batch-byte-compile /tmp/foo/foo.el 

-> generates /tmp/bar/foo.elc

batch-byte-compile exists since forever.

> I think automake generates code the way it does because GNU coding
> standards mandate that one be able to build from a read-only
> hierarchy of sources (think read-only media).

Again, not something Emacs itself supports for its own Lisp files.