Clojure-jack-in 到底是做什么的?以及如何使用 slime 配置设置?
Clojure-jack-in 到底是做什么的?以及如何使用 slime 配置设置? 我需要向 .emacs 添加什么?
what exactly does clojure-jack-in do? And how to config the settings with slime ?
What do I need to add to .emacs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
clojure-jack-in
为当前项目启动 SLIME 会话。它通过生成一个随机端口号、在子进程中使用此端口号运行 lein jack-in 、等待 swank 服务器启动然后调用 slime-connect 来实现此目的code> 与端口号。
由于 lein jack-in 是用来启动 swank 服务器的,所以你显然需要在项目中使用 Leiningen,并且需要安装 Leiningen 的 swank-clojure 插件,或者通过将其作为支架安装-alone 插件(
lein plugin install swank-clojure 1.3.2
),或者将其作为开发依赖项包含在project.clj
中。在 Emacs 端,您需要安装
clojure-mode
,最好是从 Marmalade 安装。您不需要向.emacs
添加任何内容。使用 lein jack-in(通过 Mx clojure-jack-in)与运行 lein swank 的区别在于 clojure- jack-in 还加载与 swank-clojure Leiningen 插件捆绑在一起的 SLIME 版本,而不是 Emacs 中安装的 SLIME 版本。我不确定这背后的原因是什么,大概只是为了确保 SLIME 版本与 swank 服务器兼容。
clojure-jack-in
starts a SLIME session for your current project.It does this by generating a random port number, running
lein jack-in
with this port number in a sub-process, waiting for the swank server to start and then callingslime-connect
with the port number.Since
lein jack-in
is used to start the swank server, you obviously need to use Leiningen in your project and you need to have the swank-clojure plugin for Leiningen installed, either by installing it as a stand-alone plugin (lein plugin install swank-clojure 1.3.2
), or by including it as a dev-dependency in yourproject.clj
.On the Emacs side, you need to install
clojure-mode
, preferably from Marmalade. You shouldn't need to add anything to your.emacs
.The difference between using
lein jack-in
(viaM-x clojure-jack-in
) vs. runninglein swank
is thatclojure-jack-in
also loads a version of SLIME that is bundled with the swank-clojure Leiningen plugin instead of the SLIME version installed in Emacs. I'm not sure what's the reasoning behind this, presumably just to make sure the SLIME version is compatible with the swank server.