Emacs 无法加载其启动文件
我将远程终端上的 emacs 升级到 23-snapshot。 由于我在那里没有 root 权限,因此我进行了“make install”,并将“prefix”设置为我的主目录中的一个文件夹。 现在,当我启动 emacs 时,它给出错误“无法打开加载文件:encoded-kb”,它也无法运行 dired 或加载 cc 模式。 我尝试用“--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 源代码是使用 update2 从 cvs 获取的
cvs -d:pserver:[email protected]:/sources/emacs co emacs
: 感谢查理和特雷的回答。 我想我会跳过“make install”并暂时坚持使用 src/emacs。 干杯。
I upgraded emacs on a remote terminal to 23-snapshot. As I did not have root privileges there, I did 'make install' with 'prefix' set to a folder in my home directory. Now when I start emacs, it gives an error 'Cannot open load file: encoded-kb', it, also, is unable to run dired or load cc-mode. I tried starting it with '--no-site-file', '-Q', '-q', all have the same issue. My .emacs is empty. Any suggestions?
Thanks for your help.
Regards,
Nishith
Update: These are the messages I get when I try to run 'emacs' no arguments.
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.
Its a 64 bit system. Emacs source code was take from the cvs using
cvs -d:pserver:[email protected]:/sources/emacs co emacs
update2:
Thanks Charlie and Trey for your answers. I think I will skip the 'make install' and stick to using the src/emacs for the time being.
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我在 AIX 上构建 emacs 23.1 时遇到了同样的问题。 就我而言,我想在我的目录中安装 emacs,因为我是唯一使用 emacs 的开发人员。 该问题可以通过在运行configure 之前修改src/epaths.in 文件中的路径来解决。 配置使用此文件来创建 epaths.h。 --prefix= 参数不会更改 epaths.in 文件中的路径。 使用 --prefix= 并修改 epaths.in 文件解决了我的问题。
I ran into this same problem doing a build of emacs 23.1 on AIX. In my case, I wanted to install emacs in my directory, as I was the only developer using emacs. The problem can be resolved by modifying the paths in the src/epaths.in file prior to running configure. Configure uses this file to create epaths.h. The --prefix= parameter does not change the paths in the epaths.in file. Using the --prefix= and modifying the epaths.in file fixed my issues.
我在 Windows 7 上构建 emacs 25.0.92 时遇到了同样的问题。
我发现了这个问题。 有一个系统注册表项:
HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs
,它定义了加载路径EMACSLOADPATH
。我只是删除注册表项来解决问题。
I ran into this same problem doing a build of emacs 25.0.92 on Windows 7.
And I found the problem. There is a system registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs
, which defines the load pathEMACSLOADPATH
.I just delete the registry key to resolve the problem.
另请检查您是否有名为
EMACSPATH
的环境变量。 Emacs 期望它是一个目录。Also check to see if you have an environment variable by the name of
EMACSPATH
. Emacs expects it to be a directory.对我来说,当我没有更改 Makefile 中的
prefix
变量,而是执行以下操作时,此错误消失了:For me, this error disappeared when I instead of changing the
prefix
variable in the Makefiles, did a:AFAIK,如果您想在系统范围内安装软件包,则需要
make install
。 前缀仅定义系统范围安装的前缀路径,但它仍然需要正确的目录层次结构(bin/、/lib、/share 等)。 如果您只想使用 CVS Emacs,则可以在make
过程之后立即运行它。 例如,我的 Emacs 源代码位于~/src/emacs/
,我只需输入~/src/emacs/src/emacs
即可运行Emacs。AFAIK,
make install
is needed in case of you want to install a package system-wide. Prefix only defines the prefix path of that system-wide installation, but it still requires the proper directory hierarchy (bin/, /lib, /share, etc). If you simply want to use CVS Emacs, you can run it right after themake
procedure. For instance, my Emacs' source code is located at~/src/emacs/
, and I can simply type~/src/emacs/src/emacs
in order to run Emacs.“encoded-kb.el”位于 EMACS lisp 目录中的标准国际化代码中,因此某些内容未获得正确的路径。 你的负载路径被浇在某处。 makefile 中有一些钩子可以让您显式设置加载路径来解决这个问题。
启动后尝试转储您的加载路径,例如使用
(pp load-path)
并查看它真正看到的内容。 要对其进行评估,请输入您的
*scratch*
缓冲区。 该缓冲区应该处于 lisp 交互模式。^j
(Control-j,又名 Cj)表示对其进行评估。 并且pp
将漂亮地打印列表。"encoded-kb.el" is in the standard internationalization code in the EMACS lisp directories, so something is not getting the right path. Your load-path is hosed somewhere. There are hooks in the makefile to let you explicitly set what the load-path should be to fix that.
Try dumping your load-path after you start up, say with
(pp load-path)
and see what it's really looking at. To evaluate that, typein your
*scratch*
buffer. That buffer should be in lisp-interaction mode. The^j
(Control-j, aka C-j) says to evaluate it. and thepp
will pretty-print the list.就我而言,我的 MacOSX 只是指向旧版本的 Emacs,我不知道为什么。 因此,当我在图形界面上打开它时,一切正常,但当我尝试在终端上打开它时,我收到了该错误。 因此,我首先找到快捷方式指向的位置并修复
/usr/bin/emacs
路径,如下所示:In my case my MacOSX was just pointing to an old version of Emacs, I don't know why. So, when I open it on graphical interface everything was OK but when I tried to open it on a terminal I got that error. So, I first find where the shortcut was pointing to and fixed the
/usr/bin/emacs
path like this: