summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--cider.el8
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 963ce2ad..b363f30d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@
* [#2307](https://github.com/clojure-emacs/cider/pull/2307): Use a better error when a cljs repl form cannot be found.
* Fix the broken test selector functionality.
* [#2291](https://github.com/clojure-emacs/cider/issues/2291): `cider-use-tooltips` custom variable works as expected.
+* [#2424](https://github.com/clojure-emacs/cider/issues/2424): Fallback to `lein` as the default jack-in command when `clojure` is not present.
### Changes
diff --git a/cider.el b/cider.el
index 8f63f9b2..99db9ded 100644
--- a/cider.el
+++ b/cider.el
@@ -214,12 +214,14 @@ By default we favor the project-specific shadow-cljs over the system-wide."
:safe #'stringp
:package-version '(cider . "0.10.0"))
-(defcustom cider-jack-in-default "clojure-cli"
+(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."
+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")
@@ -1369,6 +1371,8 @@ PROJECT-DIR defaults to the current project."
choices nil t nil nil default))
(choices
(car choices))
+ ;; if we're outside a project we fallback to whatever tool
+ ;; is specified in `cider-jack-in-default' (normally clojure-cli)
(t cider-jack-in-default))))