From: rclayton@monmouth.edu (R. Clayton)
To: help-gnu-emacs@gnu.org
Subject: Re: byte-compile-file: emacs vs the command line.
Date: Sun, 29 Dec 2013 10:59:55 -0500 [thread overview]
Message-ID: <87zjnjzlz8.fsf@UlanBator.myhome.westell.com> (raw)
In-Reply-To: 877gaopphr.fsf@UlanBator.myhome.westell.com
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.
--
next prev parent reply other threads:[~2013-12-29 15:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-28 22:41 byte-compile-file: emacs vs the command line R. Clayton
2013-12-29 15:59 ` R. Clayton [this message]
2013-12-29 16:26 ` Eli Zaretskii
2013-12-30 5:19 ` R. Clayton
2013-12-30 7:20 ` Thierry Volpiatto
2013-12-30 10:34 ` Peter Dyballa
2013-12-30 16:23 ` R. Clayton
2013-12-30 19:27 ` Peter Dyballa
2014-01-01 2:52 ` R. Clayton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zjnjzlz8.fsf@UlanBator.myhome.westell.com \
--to=rclayton@monmouth.edu \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).