我的 emacs/slime 设置有什么问题(编译和加载/评估不起作用)?
我可以运行 emacs 并启动 slime(使用 Mx slime
)。此时,我在 inferior-lisp 缓冲区中获取了 REPL,并且可以在那里运行 lisp。但是,当我在另一个缓冲区中打开 lisp 代码时,所有的 slime-goodness 都不起作用(Cx Ce
、Cc Ck
等),而且我一直在 中看到这一点消息缓冲区(计数递增):
slime-connection:未连接。
投票 “/var/folders/B9/B9B5J15dH+aNt5J5gkROEk+++TI/-Tmp-/slime.3202”..(使用 `Mx 中止 slime-abort-connection'.) [69 次]
让我觉得 slime 没有连接到正确的 lisp 解释器,但由于我对 emacs 和 lisp 很陌生,所以我被困在这里。我的设置是:
- Mac OSX Snow Leopard
- GNU Emacs 23.2
- emacs-starter-kit
- 很少的自定义:arnab.el 和 arnab下的文件/
I can run emacs and start slime (with M-x slime
). At this point I get the REPL in the inferior-lisp buffer and can run lisp there. But when I open up lisp code in another buffer none of the slime-goodness works (C-x C-e
, C-c C-k
etc.) and I keep seeing this in the Messages buffer (with an increasing count-number):
slime-connection: Not connected.
Polling
"/var/folders/B9/B9B5J15dH+aNt5J5gkROEk+++TI/-Tmp-/slime.3202".. (Abort with `M-x
slime-abort-connection'.) [69 times]
Makes me think slime is not connecting to the correct lisp interpreter, but since I am very new to emacs and lisp I am stuck here. My setup is:
- Mac OSX Snow Leopard
- GNU Emacs 23.2
- emacs-starter-kit
- very few customizations: arnab.el and the files under arnab/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是我为使 Common Lisp 和 Clojure 与优秀的 emacs-starter-kit 一起在同一个 Emacs 安装中工作而所做的工作。这不会让你同时使用两者(你必须重新启动 Emacs 才能从 CL 切换到 Clojure,反之亦然)
我相信 ELPA 中的 SLIME 版本很旧,但适用于 Clojure。较新版本的 SLIME 不适用于 Clojure。此外,这个版本的 SLIME 似乎被精简了(没有 swank-loader.el?)并且无法与 Common Lisp 一起使用。
这些是我为使其发挥作用而采取的步骤,这对我来说很有效。所有的部分都在积极开发中,所以我认为这方面的破坏很可能。
使用全新的 Emacs(根本没有任何配置,因此暂时将任何
.emacs
移动到其他地方)安装 ELPA:http://tromey.com/elpa/install.html
在 Emacs 中,安装软件包“slime”和“slime-repl”。 (
Mx package-list-packages
然后Cs slime
然后i
选择并x
安装)移动文件将
~/.emacs.d/elpa/slime-20100404
和~/.emacs.d/elpa/slime-repl-20100404
复制到新目录,如~/hacking/lisp/elpa-slime
。放弃 ELPA 安装:
$ rm -rf .emacs.d
。现在克隆 emacs-starter-kit 并将其移动到
.emacs.d
。我只使用了来自 technomancy 的 Github 的新副本来完成此操作,因此如果您遇到问题,请先尝试一下。使用 CVS 获取最新的 SLIME:
我认为 OS X 没有安装 CVS,因此您需要从 Macports、Homebrew 等安装它。
我将
cvs-slime
放入~/hacking/lisp
中。希望下面的 Emacs Lisp 的作用显而易见:
对于 Clojure,您必须在端口 4005 上启动 Clojure 运行时和 swank-clojure ,我认为使用 Leiningen 是经过批准的方法:
创建一个新项目:
在
project.clj
中:然后:
编辑添加:
如果您在使用此设置时发现 SLIME REPL 中的 Paredit 损坏,请检查以下内容:
http://www.emacswiki.org/emacs/ParEdit#toc3
至少一个另一个潜在的问题是,据我所知,如果您打开 Common Lisp 源文件然后启动 SLIME,您将无法将表单从第一个缓冲区发送到 SLIME 缓冲区。因此,在打开任何 Common Lisp 源文件之前打开一个 SLIME 缓冲区,它应该可以工作。这似乎不适用于 Clojure。
参考文献:
使用 slime-fancy (slime-autodoc) 为 clojure 和 common lisp 设置 emacs
https://github.com/technomancy/swank-clojure/issues/close#issue/31/comment/544166
The following is what I did to get Common Lisp and Clojure to work in the same Emacs installation, along with the excellent emacs-starter-kit. This won't let you use both at the same time (you have to restart Emacs to switch from CL to Clojure or vice versa)
I believe that the version of SLIME in ELPA is old, but works for Clojure. Newer version of SLIME won't work for Clojure. Additionally, this version of SLIME seems to be stripped down (no swank-loader.el?) and won't work with Common Lisp.
These are the steps I did to get this to work, it's just what worked for me. All of the bits are under active development, so I think breakage in this area is pretty likely.
With a fresh Emacs (no configuration at all, so move anything
.emacs
somewhere else for the moment) install ELPA:http://tromey.com/elpa/install.html
From within Emacs, install the packages "slime" and "slime-repl". (
M-x package-list-packages
thenC-s slime
theni
to select andx
to install)Move the files in
~/.emacs.d/elpa/slime-20100404
and~/.emacs.d/elpa/slime-repl-20100404
to a new directory like~/hacking/lisp/elpa-slime
.Throw out the ELPA install:
$ rm -rf .emacs.d
.Now clone the emacs-starter-kit and move it to
.emacs.d
. I only did this with a fresh copy from technomancy's Github, so try that first if you have problems.Get the latest SLIME with CVS:
I don't think OS X comes with CVS installed, so you'll need to install it from Macports, Homebrew or something.
I put
cvs-slime
in~/hacking/lisp
.Hopefully it's obvious what the Emacs Lisp below does:
For Clojure you'd have to start the Clojure runtime and
swank-clojure
on port 4005, I think using Leiningen is the approved method:Create a new project:
In
project.clj
:Then:
Edited to add:
If you find that Paredit in the SLIME REPL is broken while using this setup, check this out:
http://www.emacswiki.org/emacs/ParEdit#toc3
At least one other potential issue with this is that, AFAICT, if you open a Common Lisp source file and then start SLIME, you won't be able to send forms from the first buffer to the SLIME buffer. So open a SLIME buffer before opening any Common Lisp source files, and it should work. This doesn't seem to apply to Clojure.
References:
emacs setup for both clojure and common lisp with slime-fancy (slime-autodoc)
https://github.com/technomancy/swank-clojure/issues/closed#issue/31/comment/544166
如果您在系统中正确安装了 slime,那么最好使用 sbcl 并在
~/.emacs
中添加以下行<代码>
(setq 下级 lisp 程序“/usr/bin/sbcl”)
/usr/bin/sbcl 可能会根据您的 sbcl 安装路径而有所不同。
If u have correctly install slime in your system then better use sbcl and add the following line in your
~/.emacs
(setq inferior-lisp-program "/usr/bin/sbcl")
/usr/bin/sbcl can be different according to your sbcl installation path.