emacs - 'cider-jack-in' 在没有 clojure 项目的情况下运行 clojure 而不是 leiningen
问题描述
我试图在没有我只想运行 Clojure REPL 的 Clojure 项目的情况下从 emacs 执行“cider-jack-in”。但是我发现苹果酒正在尝试运行/usr/local/bin/clojure
而/usr/local/bin/lein
不是参考我profiles.clj
的 Leiningen 设置。lein
当我尝试使用 Clojure 项目时,它通常可以使用。
我想知道有什么原因,即使我lein repl
在终端中尝试没有 Clojure 项目时没有问题,我希望 Cider 这样做,以及设置通过 Cider 运行 Leiningen 的方法,而不需要 Clojure 项目。
我将不胜感激对此的任何评论。
解决方案
在 CIDER 0.18(当前稳定版本)上,您需要设置cider-jack-in-default
为符号,而不是字符串(例如'lein
)。
(define-obsolete-variable-alias 'cider-default-repl-command 'cider-jack-in-default)
(defcustom cider-jack-in-default (if (executable-find "clojure") 'clojure-cli 'lein)
"The default tool to use when doing `cider-jack-in' outside a project.
This value will only be consulted when no identifying file types, i.e.
project.clj for leiningen or build.boot for boot, could be found.
As the Clojure CLI is bundled with Clojure itself, it's the default.
In the absence of the Clojure CLI (e.g. on Windows), we fallback
to Leiningen."
:type '(choice (const 'lein)
(const 'boot)
(const 'clojure-cli)
(const 'shadow-cljs)
(const 'gradle))
:group 'cider
:safe #'symbolp
:package-version '(cider . "0.9.0"))
旧变量确实接受了一个字符串,这是真的。如果没有看到完整的堆栈跟踪,我无法确定您到底出了什么问题。一般来说,最好在 CIDER 的问题跟踪器上提出此类问题。
如果有人想知道为什么现在 CIDER 使用clojure-cli
而不是lein
用于无项目 REPL - 我们的想法是 Clojure CLI 是我们可以假设每个 Clojure 用户都会拥有的唯一工具,因此它是一个更安全的默认设置。
推荐阅读
- webview - AeroGear SSO 登录使用 Keycloak 后端嵌入式 Safari 浏览器而不是外部 Safari 浏览器
- c++ - 为什么 c++ 中的引用传递用 functionName(dataType& variableName) 表示?
- c++ - 如何获取泛型类成员函数的函数指针?
- symfony - Symfony3.4 独白包未写入自定义频道文件
- python - Celery:如何自定义多处理池初始化?
- java - 在 android 中转到应用程序的特定部分
- python - 从代码单元跳转到特定代码单元(即以编程方式)(jupyter / ipython)
- spring - Spring:如何在JSP中获取模型属性并检查它是否为空?
- react-native - 使用 asyncstorage 对本机更改状态做出反应
- java - 在android中更改两个模块的包名的问题