I am using Gnu Emacs 24.3 on Ubuntu 12.04.
I downloaded dired+.el
from here: http://www.emacswiki.org/emacs/dired%2b.el . I then tried to byte-compile this file in Emacs. I made a file bytecomp.el
:
(byte-compile-file "dired+.el")
and run the following command:
bash$ emacs -batch -l bytecomp.el -kill
and got the following error message:
In toplevel form:
dired+.el:1114:1:Error: Cannot open load file: dired+
Update
Changing the file bytecomp.el
to:
(add-to-list 'load-path "~/emacs/test/bytecompile")
(byte-compile-file "dired+.el")
and running emacs -batch -l bytecomp.el -kill
from the same directory ( ~/emacs/test/bytecompile
) gives another error message:
Recursive load: "/home/fcihh/emacs/test/bytecompile/bytecomp.el", "/home/fcihh/emacs/test/bytecompile/bytecomp.el", "/home/fcihh/emacs/test/bytecompile/bytecomp.el", "/home/fcihh/emacs/test/bytecompile/bytecomp.el", "/home/fcihh/emacs/test/bytecompile/bytecomp.el"
You need to put
dired+.el
in yourload-path
.dired+.el
explicitly does this:This is an Emacs-Lisp idiom that ensures that the library is loaded before compiling it. For Dired+ this is appropriate.
So do this:
The relevant doc for the idiom used here is (elisp)
Named Features
. Here is a bit of it: