From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rclayton@monmouth.edu (R. Clayton) Newsgroups: gmane.emacs.help Subject: Re: byte-compile-file: emacs vs the command line. Date: Sun, 29 Dec 2013 10:59:55 -0500 Message-ID: <87zjnjzlz8.fsf@UlanBator.myhome.westell.com> References: <877gaopphr.fsf@UlanBator.myhome.westell.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1388332837 7185 80.91.229.3 (29 Dec 2013 16:00:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Dec 2013 16:00:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 29 17:00:41 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VxInB-00045d-3v for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 17:00:41 +0100 Original-Received: from localhost ([::1]:55562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxInA-0003eb-Mi for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 11:00:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxImo-0003dH-2B for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 11:00:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxImg-0000YW-Ol for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 11:00:18 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:38792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxImg-0000YC-Hk for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 11:00:10 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VxIme-0003l2-CI for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 17:00:08 +0100 Original-Received: from pool-96-234-46-56.nwrknj.fios.verizon.net ([96.234.46.56]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Dec 2013 17:00:08 +0100 Original-Received: from rclayton by pool-96-234-46-56.nwrknj.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Dec 2013 17:00:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 75 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-96-234-46-56.nwrknj.fios.verizon.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:YEO6TO4rjNbJxIwGtVHGajZWXoc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95178 Archived-At: 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. --