【发布时间】:2014-09-07 16:59:37
【问题描述】:
我无法按照在 Emacs 上安装 speedbar 的说明进行操作。
步骤 1. 将 Lisp:sr-speedbar.el 放入你的加载路径,添加 (需要 'sr-speedbar)
好的,将“sr-speedbar.el”放在我的加载路径中。 (首先我假设我的加载路径是我根目录中的 .emacs.d 目录。
我去这个链接:http://www.emacswiki.org/emacs/sr-speedbar.el 点击下载按钮,我最终不得不复制/粘贴整个文件,将其保存为 sr-speedbar.el 在我的 .emacs.d 目录中。
~/.emacs.d 现在有 sr-speedbar.el 并且我的 .emacs 文件有以下代码:
1 (add-to-list 'load-path "~/.emacs.d/evil")..
2 (require 'evil)..
3 (evil-mode 1)
4 (require 'sr-speedbar)
~
~
所以我关闭了emacs,打开它并得到这个错误:
Warning (initialization): An error occurred while loading `/Users/johncurry/.emacs':
File error: Cannot open load file, sr-speedbar
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.
所以我 $ emacs --debug-init
Debugger entered--Lisp error: (file-error "Cannot open load file" "sr-speedbar"$
require(sr-speedbar)
eval-buffer(#<buffer *load*> nil "/Users/johncurry/.emacs" nil t) ; Reading$
load-with-code-conversion("/Users/johncurry/.emacs" "/Users/johncurry/.emacs"$
load("~/.emacs" t t)
#[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312$
command-line()
normal-top-level()
sr-speedbar-open 在 emacs 中不返回匹配项。知道怎么弄错吗?我确定只是我不理解说明,但我需要这方面的帮助。
【问题讨论】:
-
最可能的情况是您的
sr-speedbar.el库在您的load-path中不。因此,您可以将sr-speedbar.el移动到您的load-path中已经存在的目录中,或者您可以将该目录添加到load-path所在的load-path中。几分钟前有一个关于向~/.emacs.d目录添加子目录的帖子——例如,创建一个名为lisp的目录并将其添加到您的load-path并将您的sr-speedbar.el文件放在那里: stackoverflow.com/a/24791753/2112489 -
我很确定我把它放在我的加载路径中,我安装的所有其他东西都在工作。这是我的 emacs.d 文件:.emacs.d johncurry$ ls Cask emacs-nav-49 framemove.el auto-save-list evil init.el 它有 sr-speedbar.el 但我将其删除并使用 emacs- nav-49 工作正常。
-
@JohnCurry 你有没有解决这个问题?我在使用 emacs 24.4.1 时遇到了同样的问题