简体   繁体   中英

'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. 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. It's normally work with lein when I try with a Clojure project.

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.

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 ).

(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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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