我正在尝试让 Slime 与 CDT 和 emacs 24 一起使用,但没有成功,希望得到建议。
1)我确实让 clojure-jack-in 运行,但只有当我将 swank-clojure 1.3.3 作为 lein 插件加载时,如 github swank-clojure 页面中所述, https://github.com/technomancy/swank-clojure。
2)我尝试按照 George Jahad 在 http 中所述加载 swank-clojure 1.4.0-SNAPSHOT: //georgejahad.com/clojure/swank-cdt.html(使用Clojure 1.2.1),但我不能clojure-jack-in 来运行。我遇到了与下面 3) 中所述相同的错误。
3) 最近,我尝试复制 technomancy.us 网站上概念验证短视频的结果,内容是“随之而来的是彻底的简化”http://technomancy.us/149。在这个方法中,我将 swank-clojure 1.4.0-SNAPSHOT 作为 lein 插件加载,并确认它已加载到 ~/.lein/plugins/swank-clojure-1.4.0-SNAPSHOT.jar
。当我创建一个新的 lein 项目时,对其执行 lein deps ,在 emacs 中打开项目的 core.clj 文件,然后执行 Mx clojure-jack-in ,而不是获取 REPL 后,我在 emacs minibuffer 中收到以下错误:
error in process filter: Search failed: "(run-hooks 'slime-load-hook) ;
on port"
请注意,错误字符串的末尾不包含端口号。除非这是对较长错误字符串的任意截断,否则缺少端口号会让我感到不安。
*swank*
缓冲区很长,以:开头
;;; Bootstrapping bundled version of SLIME; please wait...
,以:结尾
(provide 'slime-repl)
;;; slime-repl.el ends here
(run-hooks 'slime-load-hook)
;;; proceed to jack in
,与错误消息一致。
我为此花费了大约六个小时,其中包括大量的网络搜索,但没有成功。感谢您提供的任何帮助。
附录:我继续进行实验,现在 *swank* 缓冲区像以前一样结束(死在同一个地方),但末尾有额外的行。仅供参考,这里是:(
(provide 'slime-repl)
;;; slime-repl.el ends here
(run-hooks 'slime-load-hook)
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository clojars at http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojars (http://clojars.org/repo/)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository stuartsierra-releases at http://stuartsierra.com/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository stuartsierra-releases (http://stuartsierra.com/maven2)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository clojure at http://build.clojure.org/releases
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojure (http://build.clojure.org/releases)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository clojure-snapshots at http://build.clojure.org/snapshots
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojure-snapshots (http://build.clojure.org/snapshots)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository central at http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository central (http://repo1.maven.org/maven2)
Copying 9 files to /Users/gw/tech/clojurestuff/cljprojects/infwb/lib
Copying 1 file to /Users/gw/tech/clojurestuff/cljprojects/infwb/lib/dev
Listening for transport dt_socket at address: 61012
;;; proceed to jack in
附录末尾)
附录 2(2011 年 12 月 12 日)感谢所有提供帮助的人,特别是 @ivant,我向他授予“复选标记”。我将考虑结束这种情况,因为我已经放弃尝试修复它。由于我使用了预打包的初始化包,我确信它非常好,所以事情变得很复杂,但我无法理解它在做什么,也不知道它是否会导致问题。
我用“干净”的 Emacs 24 重新启动并恢复到 swank-clojure 1.3.3,并且 clojure-jack-in
现在工作得很好。稍后,一旦记录到 swank-clojure 1.4.0-SNAPSHOT 的错误得到解决,我将尝试 CDT。
我从人们的评论中学到了一些东西——再次感谢。
I'm trying to get Slime working with CDT and emacs 24, to no avail, and would appreciate suggestions.
1) I did get clojure-jack-in to run, but only when I loaded swank-clojure 1.3.3 as a lein plugin, as described in the github swank-clojure page, https://github.com/technomancy/swank-clojure.
2) I tried to get swank-clojure 1.4.0-SNAPSHOT loaded as described by George Jahad in http://georgejahad.com/clojure/swank-cdt.html (using Clojure 1.2.1), but I couldn't clojure-jack-in to run. I got the same error as described in 3), below.
3) Most recently, I tried duplicating the results of the short proof-of-concept video on the technomancy.us site, on the "in which radical simplification ensues," http://technomancy.us/149. In this method, I loaded swank-clojure 1.4.0-SNAPSHOT as a lein plugin and confirmed it was loaded to ~/.lein/plugins/swank-clojure-1.4.0-SNAPSHOT.jar
. When I created a new lein project, did lein deps
on it, opened the project's core.clj file in emacs, and then executed M-x clojure-jack-in
, instead of getting a REPL, I got the following error in the emacs minibuffer:
error in process filter: Search failed: "(run-hooks 'slime-load-hook) ;
on port"
Note that the end of the error string does not include a port number. Unless that's an arbitrary truncation of a longer error string, the lack of a port number makes me uneasy.
The *swank*
buffer is long, beginning with:
;;; Bootstrapping bundled version of SLIME; please wait...
and ending with:
(provide 'slime-repl)
;;; slime-repl.el ends here
(run-hooks 'slime-load-hook)
;;; proceed to jack in
which is consistent with the error message.
I've spent about six hours on this, including a lot of web searches, and no luck. Thanks for any help you can provide.
ADDENDUM: I've continued experimenting, and now the *swank*
buffer ends like before (dying at the same place), but with additional lines at the end. FYI, here it is:
(provide 'slime-repl)
;;; slime-repl.el ends here
(run-hooks 'slime-load-hook)
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance from source: pom
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository clojars at http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojars (http://clojars.org/repo/)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository stuartsierra-releases at http://stuartsierra.com/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository stuartsierra-releases (http://stuartsierra.com/maven2)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository clojure at http://build.clojure.org/releases
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojure (http://build.clojure.org/releases)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository clojure-snapshots at http://build.clojure.org/snapshots
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository clojure-snapshots (http://build.clojure.org/snapshots)
Downloading: org/clojure/clojure/1.+/clojure-1.+.pom from repository central at http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure:clojure:pom:1.+' in repository central (http://repo1.maven.org/maven2)
Copying 9 files to /Users/gw/tech/clojurestuff/cljprojects/infwb/lib
Copying 1 file to /Users/gw/tech/clojurestuff/cljprojects/infwb/lib/dev
Listening for transport dt_socket at address: 61012
;;; proceed to jack in
(end of addendum)
ADDENDUM 2 (Dec. 12, 2011) Thanks to all who offered help, especially @ivant, to whom I'm awarding the "check mark." I'm going to consider this situation closed because I've given up trying to fix it. It was complicated by my use of a prepackaged initialization package that I'm sure is quite nice, but I couldn't understand what it was doing, nor whether it was contributing to the problem.
I restarted with a "clean" Emacs 24 and reverted to swank-clojure 1.3.3, and clojure-jack-in
works just fine now. I'll try CDT later, once the bug logged to swank-clojure 1.4.0-SNAPSHOT is resolved.
I learned a few things from people's comments--thanks again.
发布评论
评论(3)
注意,我既没有安装 emacs 24,也没有安装 CDT。
看看 clojure-jack-in 的代码,看起来它事先选择了一个端口,然后启动clojure 使用
lein jack-in
(除非您在某处重新定义了clojure-swank-command
)。然后,它解析输出(在
*swank*
缓冲区中可见),查找特定字符串来触发某些操作。它们是:或作为后备:
它在这些行之间执行 emacs 命令。字符串“继续插入”触发实际连接。
因此,请检查源代码,检查一些相关变量的值(例如
clojure-swank-command
),并检查*swank*
缓冲区中的内容以获取线索。编辑
您可能需要在项目中运行
lein deps
,然后再尝试Mx clojure-jack-in
,否则输出可能会出现在
*swank*
缓冲并可能干扰启动过程。但这种特定的依赖性对我来说看起来很可疑。您也可以发布您的
project.clj
文件吗?N.B. I don't have neither emacs 24, nor CDT installed.
Looking at the code of
clojure-jack-in
, it looks like it chooses a port beforehand, and starts clojure usinglein jack-in <port>
(unless you redefinedclojure-swank-command
somewhere).It then parses the output (which is visible in the
*swank*
buffer) looking for specific strings to trigger some actions. These are:or as a fallback:
and it executes the emacs commands between these lines. The string "proceed to jack in" triggers the actual connect.
So check the source, check the values of some relevant variables (like
clojure-swank-command
) and check what's in the*swank*
buffer for clues.EDIT
You may want to run
lein deps
in your project, brfore tryingM-x clojure-jack-in
, otherwise output likecan end up in the
*swank*
buffer and can interfere with the starting process.But this specific dependency looks quite suspicious to me. Can you post your
project.clj
file as well?升级到 swank-clojure 1.4.0(昨天发布),一切都将开箱即用。
lein plugin install swank-clojure 1.4.0
CDT 安装和集成现在完全自动化。确保删除您周围的 swank-clojure、slime.el 和 slime-repl.el 的所有旧副本。为了安全起见,还要确保您安装了最新的 clojure-mode.el。
Upgrade to swank-clojure 1.4.0 (released yesterday) and everything will just work out of the box.
lein plugin install swank-clojure 1.4.0
CDT installation and integration are now completely automated. Make sure to remove any old copies of swank-clojure, slime.el and slime-repl.el you have lying around. Just to be safe, also make sure you've got the latest clojure-mode.el installed.
我没有答案,虽然我遇到了同样的问题,但我可以提供解决方法。
只需从命令行运行 lein swank 并在 Emacs 中使用 slime-connect ,您至少将再次拥有一个工作环境。
这也已被记录在 swank-clojure 错误列表中:
https://github.com/technomancy/swank-clojure/issues/87
I don't have an answer, although I've hit this same problem, but I can provide a work around.
Just run
lein swank
from the commandline and useslime-connect
inside Emacs, and you'll at least have a working environment again.This has also been filed on the swank-clojure bug list:
https://github.com/technomancy/swank-clojure/issues/87