Emacs无法加载其启动文件。

7
我在远程终端上将emacs升级到了23-snapshot。由于我没有root权限,因此我使用“prefix”设置到我的主目录中的一个文件夹中进行了“make install”。现在当我启动emacs时,它会出现错误“无法打开加载文件:encoded-kb”,同时也无法运行dired或加载cc-mode。我尝试使用“--no-site-file”、“-Q”、“-q”启动它,但都有相同的问题。我的.emacs是空的。有任何建议吗?
谢谢您的帮助。
问候, Nishith
更新:这些是我尝试运行'emacs'时不带参数得到的信息。
Warning: arch-dependent data dir (/usr/local/libexec/emacs/23.0.93/x86_64-unknown-linux-gnu/) does not exist.
Warning: Lisp directory `/usr/local/share/emacs/23.0.93/site-lisp' does not exist.
Warning: Lisp directory `/usr/local/share/emacs/site-lisp' does not exist.
Warning: Lisp directory `/usr/local/share/emacs/23.0.93/lisp' does not exist.
Warning: Lisp directory `/usr/local/share/emacs/23.0.93/leim' does not exist.

这是一个64位系统。Emacs源代码是通过cvs获取的。

cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs

更新2: 感谢Charlie和Trey的回答。我想我会跳过“make install”,暂时继续使用src/emacs。 干杯。


你能展示一下启动Emacs时你收到的更多信息吗? - viam0Zah
7个回答

5

对我而言,当我不是在 Makefiles 中更改 prefix 变量,而是执行以下操作时,此错误消失了:

./configure --prefix=/my_special_path/usr/local

如果您想进行非全局安装,那么这就是您应该采取的步骤。+1 - Noufal Ibrahim

2

在我的情况下,我的MacOSX只是指向了一个旧版本的Emacs,我不知道为什么。因此,当我在图形界面上打开它时一切正常,但当我尝试在终端上打开它时,我遇到了这个错误。所以,我首先找到快捷方式指向的位置,并像这样修复了/usr/bin/emacs路径:

$ emacs --version
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$ whereis emacs
/usr/bin/emacs
$ sudo rm /usr/bin/emacs 
$ sudo ln -s /usr/local/Cellar/emacs/HEAD/bin/emacs /usr/bin/emacs
$ emacs --version
GNU Emacs 24.4.50.1
Copyright (C) 2014 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

对我有用。谢谢。 - avichalp

2
"

“encoded-kb.el”在EMACS lisp目录中是标准的国际化代码,所以某些内容没有得到正确的路径。您的load-path在某个地方出现了问题。在makefile中有钩子可以让您明确设置load-path以修复该问题。

尝试在启动后转储您的load-path,例如使用(pp load-path),并查看它实际上正在查找什么。要评估它,请键入

"
(pp load-path)^j

在你的*scratch*缓冲区中。该缓冲区应处于lisp-interaction模式。 ^j(Control-j,又称C-j)表示要对其进行评估。 pp将对列表进行漂亮打印。


2
据我所知,如果您想要在整个系统中安装一个软件包,则需要使用make install命令。Prefix仅定义该系统范围内安装的前缀路径,但仍需要正确的目录层次结构(bin/、/lib、/share等)。如果您只想使用CVS Emacs,则可以在make过程之后直接运行它。例如,我的Emacs源代码位于~/src/emacs/,我只需键入~/src/emacs/src/emacs即可运行Emacs。

1
我在Windows 7上构建Emacs 25.0.92时遇到了同样的问题。
D:\emacs\bin>emacs
Warning: arch-dependent data dir 'd:/emacs/libexec/emacs/24.5/x86_64-w64-mingw32/': Invalid argument
Warning: arch-independent data dir 'd:/emacs/share/emacs/24.5/etc/': Invalid argument
Warning: Lisp directory 'd:/emacs/share/emacs/24.5/site-lisp': Invalid argument
Warning: Lisp directory 'D:/emacs/share/emacs/24.5/lisp': Invalid argument

我找到了问题所在。有一个系统注册表键:HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs,它定义了加载路径EMACSLOADPATH
我只需删除注册表键即可解决问题。

1

我在AIX上构建emacs 23.1时遇到了同样的问题。在我的情况下,我想将emacs安装在我的目录中,因为我是唯一使用emacs的开发人员。可以通过在运行configure之前修改src/epaths.in文件中的路径来解决该问题。Configure使用此文件创建epaths.h。--prefix=参数不会更改epaths.in文件中的路径。使用--prefix=并修改epaths.in文件解决了我的问题。


0

同时检查一下是否有名为EMACSPATH的环境变量。Emacs期望它是一个目录。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接