【发布时间】:2013-12-11 18:07:15
【问题描述】:
我在 Ubuntu 12.04 上使用 Gnu Emacs 24.3。
我从这里下载了dired+.el:http://www.emacswiki.org/emacs/dired%2b.el。然后我尝试在 Emacs 中对这个文件进行字节编译。我做了一个文件bytecomp.el:
(byte-compile-file "dired+.el")
并运行以下命令:
bash$ emacs -batch -l bytecomp.el -kill
并收到以下错误消息:
In toplevel form:
dired+.el:1114:1:Error: Cannot open load file: dired+
更新
将文件bytecomp.el 更改为:
(add-to-list 'load-path "~/emacs/test/bytecompile")
(byte-compile-file "dired+.el")
从同一目录 (~/emacs/test/bytecompile) 运行 emacs -batch -l bytecomp.el -kill 会给出另一条错误消息:
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"
【问题讨论】:
-
dired+.el在目录~/emacs/test/bytecompile中吗?如果不是,它的目录是否在您的load-path中? -
@Drew 是的,它在同一个目录中..