【问题标题】:Emacs unable to load its startup filesEmacs 无法加载其启动文件
【发布时间】:2010-10-27 20:17:50
【问题描述】:

我将远程终端上的 emacs 升级为 23-snapshot。因为我在那里没有root权限,所以我做了'make install'并将'prefix'设置为我的主目录中的一个文件夹。现在,当我启动 emacs 时,它给出了一个错误“无法打开加载文件:编码-kb”,它也无法运行 dired 或加载 cc-mode。我试着用'--no-site-file'、'-Q'、'-q'开始它,都有同样的问题。我的 .emacs 是空的。有什么建议吗?

感谢您的帮助。

问候, 尼西斯

更新:这些是我在尝试无参数运行“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: 感谢查理和特雷的回答。我想我会跳过“make install”并暂时坚持使用 src/emacs。 干杯。

【问题讨论】:

  • 你能多显示一些你在启动 Emacs 时收到的消息吗?

标签: emacs emacs23


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    我在 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。

    我只是删除注册表项来解决问题。

    【讨论】:

      【解决方案3】:

      就我而言,我的 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.
      

      【讨论】:

      • 为我工作。谢谢。
      【解决方案4】:

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

      【讨论】:

        【解决方案5】:

        对我来说,当我没有更改 Makefile 中的 prefix 变量时,这个错误消失了,而是:

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

        【讨论】:

        • +1 如果您想要非全局安装,这就是您应该做的。
        【解决方案6】:

        "encoded-kb.el" 位于 EMACS lisp 目录中的标准国际化代码中,因此 something 没有找到正确的路径。您的负载路径在某处被软管。 makefile 中有一些钩子可以让您明确设置加载路径应该是什么来解决这个问题。

        在启动后尝试转储您的加载路径,例如使用 (pp load-path) 并查看它的实际用途。要评估它,请键入

        (pp load-path)^j
        

        在您的*scratch* 缓冲区中。该缓冲区应该处于 lisp 交互模式。 ^j(Control-j,又名 C-j)说要评估它。 pp 将漂亮地打印列表。

        【讨论】:

          【解决方案7】:

          AFAIK, make install 如果您想在系统范围内安装软件包,则需要。 Prefix 只定义了系统范围安装的前缀路径,但它仍然需要正确的目录层次结构(bin/、/lib、/share 等)。如果您只是想使用 CVS Emacs,您可以在 make 过程之后立即运行它。例如,我的 Emacs 的源代码位于 ~/src/emacs/,我只需输入 ~/src/emacs/src/emacs 即可运行 Emacs。

          【讨论】:

            猜你喜欢
            • 2015-02-27
            • 1970-01-01
            • 2014-02-26
            • 1970-01-01
            • 2011-12-28
            • 1970-01-01
            • 2011-09-14
            • 1970-01-01
            • 2011-08-05
            相关资源
            最近更新 更多