【问题标题】:Initialization error caused by helm-match-pluginhelm-match-plugin 导致的初始化错误
【发布时间】:2013-09-30 15:38:28
【问题描述】:

我在 OS X Lion 上运行 GNU Emacs 版本 24.3 (9.0)(从 http://emacsformacosx.com/ 获得)。我对 emacs 比较陌生,所以我可能不知道解决我的问题的简单方法。

我最近扩展了对 helm-mode 的使用,包括 helm-locate 并让 helm 提供扩展命令建议。不幸的是,我不记得我是如何激活这些的,但我认为它一定来自自定义组界面,因为我的 .emacs 文件除了将 C-x C-f 绑定到 helm-find 之外没有任何关于 helm-mode 的内容-文件。自从我开始使用这些功能以来,当我打开 emacs 时,我收到以下错误:

Warning (initialization): An error occurred while loading `/Users/aporiac/.emacs':

File error: Cannot open load file, helm-match-plugin

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace. 

当我使用 --debut-init 标志从命令行启动 emacs 时,我得到以下信息:

Debugger entered--Lisp error: (file-error "Cannot open load file" "helm-match-plugin")
require(helm-match-plugin)
mapc(require (helm-match-plugin))
custom-theme-set-variables(user (Linum-format "%7i ") (ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#ad7fa8" "#8cc4ff" "#eeeeec"]) (ansi-term-color$
  apply(custom-theme-set-variables user ((Linum-format "%7i ") (ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#ad7fa8" "#8cc4ff" "#eeeeec"]) (ansi-ter$
  custom-set-variables((Linum-format "%7i ") (ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#ad7fa8" "#8cc4ff" "#eeeeec"]) (ansi-term-color-vector [un$
  eval-buffer(#<buffer  *load*> nil "/Users/aporiac/.emacs" nil t)  ; Reading at buffer position 5073
  load-with-code-conversion("/Users/aporiac/.emacs" "/Users/aporiac/.emacs" t t)
  load("~/.emacs" t t)
  #[nil "^H\205\276^@   \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033^@\312\307\313\314#\203#^@\315\202A^@\312\307\313\316#\203/^@\317\202A^@\315\202A^@   \320=\203=^@\321\202A^@\307^$
  command-line()
  normal-top-level()

我无法从自定义组停用 helm-match-plugin,甚至不知道这是否是问题所在。任何帮助将不胜感激。

【问题讨论】:

  • 它正在寻找一个不在加载路径中的库,因此要么该库丢失(在这种情况下,我建议删除并重新安装更新版本的 Helm),否则库在那里,但尚未正确安装/配置 Helm 以添加到加载路径。你是如何安装 Helm 的?
  • 此外,您可以从堆栈跟踪中看到,在评估 .emacs 文件中的 custom-set-variables 表单时触发了问题,因此如果您有任何 Helm 配置 之后那个,试着把它移到它上面。
  • @phils 非常感谢您的帮助!我用 package-list-packages 安装了 Helm(我相信它是在 melpa 而不是 marmalade 上?),这是在过去几个月内。尽管如此,我还是采纳了您的建议并删除了 Helm。不幸的是,即使我注释掉了越来越多的 .emacs 文件部分,错误仍然存​​在。我终于复制然后删除了 .emacs - 成功了。我现在将尝试将它一点一点地拼凑起来。您的建议给了我承担清理 .emacs 工作所需的动力。我确定我在路上的某个地方搞砸了。再次感谢!

标签: emacs emacs-helm


【解决方案1】:

phils 有用的建议和信息的帮助下,我发现问题不是特定于 helm-mode 或 helm-match-plugin,而是由于我糟糕的 .emacs 文件。我可以通过使用package-list-packages 删除 helm 来确定这一点,然后在我的 .emcas 文件中注释掉所有涉及 helm 的函数。在重新启动 emacs 时报告了另一个错误,我注释掉了相应的函数,只是为了在随后的重新启动时遇到另一个错误。最后,我复制并清除了我的 .emacs 文件,并开始将它一点一点地拼凑起来,在每次重大更改后重新启动 emacs。似乎主要问题是存在许多 (require 'modename-mode) 函数。我按照我已安装的许多软件包的说明将这些功能添加到 .emacs 中,但是,我从 melpa 或 marmalade 安装了这些软件包,我想如果它们已安装,则不需要这些软件包。

我删除了所有 (require 'modename-mode) 函数(除了 (require 'package),无论出于何种原因,它似乎都不会导致问题)和一些其他的垃圾在我的 .emacs 中乱扔垃圾,然后我重新安装了 helm。事情似乎恢复正常了。

更新:

去年我通过Spacemacs 的精彩图层系统管理我的包裹。从那以后,我几乎没有遇到过与包或初始化相关的问题。

【讨论】:

  • 对,这一切都说得通。默认情况下,软件包系统会在您的 init 文件被处理后 被初始化。因此,如果您尝试require init 文件中的其中一个包,它将不在加载路径中。另见stackoverflow.com/a/18783152/324105
  • 很高兴知道。如果刚开始使用 emacs 的用户可以立即找到此类信息,那就太好了,不是吗?再次感谢。
  • 公平地说,信息就在 Emacs 内置的手册中,在“包安装”下;所以任何用户(开始或其他)绝对可以找到它。 Emacs 确实是您将使用的文档记录最好的应用程序之一。熟悉使用手册应该是您要做的事情的首要任务。 C-h i h 是一个很好的起点。
  • 重点。我想我在这方面有点懒惰。
猜你喜欢
  • 2013-07-26
  • 2011-09-17
  • 2015-08-11
  • 2020-02-14
  • 1970-01-01
  • 2012-02-29
  • 1970-01-01
  • 2019-07-21
  • 2019-10-04
相关资源
最近更新 更多