简体   繁体   English

在没有clojure项目的情况下,“苹果酒杰克”运行clojure而不是leiningen

[英]'cider-jack-in' run clojure instead leiningen without a clojure project

I tried to execute 'cider-jack-in' from emacs without a Clojure project that I simply want to run Clojure REPL. 我试图在没有Clojure项目的情况下从emacs执行“苹果酒劫持”,而我只是想运行Clojure REPL。 But I've found that cider is trying to run /usr/local/bin/clojure instead /usr/local/bin/lein which don't refer my profiles.clj for Leiningen settings. 但我发现,苹果酒试图运行/usr/local/bin/clojure ,而不是/usr/local/bin/lein这不是指我profiles.clj为Leiningen设置。 It's normally work with lein when I try with a Clojure project. 当我尝试Clojure项目时,通常与lein一起使用。

I'm wondering there is any reason for that even there's no problem when I tried lein repl without a Clojure project in terminal which I've expected Cider to do so, and a way for setting up to run Leiningen through Cider without a Clojure project. 我想知道是否有任何原因,即使我在终端机上没有Clojure项目的情况下尝试lein repl时也没有问题(我曾希望Cider能够这样做),以及一种在没有Clojure项目的情况下通过Cider运行Leiningen的方式。

I'll appreciate for any comments on this. 我对此表示感谢。

On CIDER 0.18 (the current stable version) you need to set cider-jack-in-default to a symbol, not a string (eg 'lein ). 在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"))

The old variable did take a string, that's true. 老变量确实带了一个字符串,这是真的。 Without seeing the complete stacktrace I can't be certain what's exactly going wrong for you. 没有看到完整的堆栈跟踪信息,我无法确定到底是什么问题。 Generally it's best to bring up such problems on CIDER's issue tracker. 通常,最好在CIDER的问题跟踪器中提出此类问题。

In case someone's wondering why now CIDER uses clojure-cli instead of lein for a projectless REPLs - our thinking was that the Clojure CLI is the only tool we can assume that every Clojure user would have, so it made for a safer default. 如果有人想知道为什么lein现在使用clojure-cli而不是lein来进行lein项目的REPL-我们的想法是Clojure CLI是我们可以假定每个Clojure用户都拥有的唯一工具,因此它提供了一个更安全的默认值。

试试: (setq cider-jack-in-default 'lein)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM