[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: byte-compile-file: emacs vs the command line.
From: |
R. Clayton |
Subject: |
Re: byte-compile-file: emacs vs the command line. |
Date: |
Sun, 29 Dec 2013 10:59:55 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Why is the command-line compile failing, and how can I fix it?
require uses load, and running in batch doesn't load init files. This means
load-path doesn't contain everything it should to load local files. The fix
is to fix load-path:
$ cat rm.el
(require 'general-utils)
$ emacs --batch --exec '(byte-compile-file "rm.el")'
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs/site-start.d/50asymptote.el (source)...
Loading /etc/emacs/site-start.d/50auto-complete-el.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50flim.el (source)...
Loading /etc/emacs/site-start.d/50haskell-mode.el (source)...
Loading /usr/share/emacs23/site-lisp/haskell-mode/haskell-mode-autoloads.el
(source)...
Loading /etc/emacs/site-start.d/50haxe.el (source)...
Loading /etc/emacs/site-start.d/50lua-mode.el (source)...
Loading /etc/emacs/site-start.d/50mgp.el (source)...
Loading /etc/emacs/site-start.d/50noweb.el (source)...
Loading /etc/emacs/site-start.d/50scsh.el (source)...
Loading /etc/emacs/site-start.d/50vm.el (source)...
Loading /etc/emacs23/site-start.d/50vm-init.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
Loading /etc/emacs/site-start.d/51semi.el (source)...
Loading /etc/emacs/site-start.d/65wl.el (source)...
In toplevel form:
rm.el:1:1:Error: Cannot open load file: general-utils
$ ls -l rm.elc
ls: cannot access rm.elc: No such file or directory
$ emacs --batch --exec '(progn (push "~/lib/emacs/lisp" load-path)
(byte-compile-file "rm.el"))'
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/20apel.el (source)...
Loading /etc/emacs/site-start.d/50asymptote.el (source)...
Loading /etc/emacs/site-start.d/50auto-complete-el.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50flim.el (source)...
Loading /etc/emacs/site-start.d/50haskell-mode.el (source)...
Loading /usr/share/emacs23/site-lisp/haskell-mode/haskell-mode-autoloads.el
(source)...
Loading /etc/emacs/site-start.d/50haxe.el (source)...
Loading /etc/emacs/site-start.d/50lua-mode.el (source)...
Loading /etc/emacs/site-start.d/50mgp.el (source)...
Loading /etc/emacs/site-start.d/50noweb.el (source)...
Loading /etc/emacs/site-start.d/50scsh.el (source)...
Loading /etc/emacs/site-start.d/50vm.el (source)...
Loading /etc/emacs23/site-start.d/50vm-init.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el.el (source)...
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
Loading /etc/emacs/site-start.d/51semi.el (source)...
Loading /etc/emacs/site-start.d/65wl.el (source)...
Wrote /home/rclayton/.emacs.d/rm.elc
$ ls -l rm.elc
-rw------- 1 rclayton rclayton 526 Dec 29 10:51 rm.elc
$
There are probably other ways to fix load-path - loading the init files, for
example.
--
- byte-compile-file: emacs vs the command line., R. Clayton, 2013/12/28
- Re: byte-compile-file: emacs vs the command line.,
R. Clayton <=
- Re: byte-compile-file: emacs vs the command line., Eli Zaretskii, 2013/12/29
- Re: byte-compile-file: emacs vs the command line., R. Clayton, 2013/12/30
- Re: byte-compile-file: emacs vs the command line., Thierry Volpiatto, 2013/12/30
- Re: byte-compile-file: emacs vs the command line., Peter Dyballa, 2013/12/30
- Re: byte-compile-file: emacs vs the command line., R. Clayton, 2013/12/30
- Re: byte-compile-file: emacs vs the command line., Peter Dyballa, 2013/12/30
- Re: byte-compile-file: emacs vs the command line., R. Clayton, 2013/12/31