branch: elpa/inf-clojure
commit ac11ae287b6343c7dadaa7b031d5c052a3af0567
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Add clojure-clr REPL type for clr.tools.deps
ClojureCLR now has its own deps-based tooling via clr.tools.deps,
started with the Clojure.Main dotnet tool. Add a clojure-clr REPL
type that uses the base Clojure features with Exception instead of
Throwable in the arglists catch clause (CLR has no Throwable).
---
inf-clojure.el | 6 ++++++
test/inf-clojure-tests.el | 8 +++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index 3f833970a1..3e55fe06db 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -77,6 +77,7 @@
(boot . "boot repl")
(clojure . "clojure")
(cljs . "clojure -M -m cljs.main -r")
+ (clojure-clr . "Clojure.Main")
(lein-clr . "lein clr repl")
(planck . "planck -d")
(babashka . "bb")
@@ -138,6 +139,10 @@ via `inf-clojure--merge-repl-features'.")
(babashka . ,(copy-alist inf-clojure--clojure-repl-base-features))
(node-babashka . ,(copy-alist inf-clojure--clojure-repl-base-features))
(clojure . ,(copy-alist inf-clojure--clojure-repl-base-features))
+ (clojure-clr . ,(inf-clojure--merge-repl-features
+ inf-clojure--clojure-repl-base-features
+ '((arglists .
+ "(try (-> '%s clojure.core/resolve
clojure.core/meta :arglists) (catch Exception e nil))"))))
(lein-clr . ,(inf-clojure--merge-repl-features
inf-clojure--clojure-repl-base-features
'((arglists .
@@ -474,6 +479,7 @@ port is an integer, or a string to startup an interpreter
like
Should be a symbol that is a key in `inf-clojure-repl-features'."
:package-version '(inf-clojure . "3.0.0")
:type '(choice (const :tag "clojure" clojure)
+ (const :tag "clojure-clr" clojure-clr)
(const :tag "cljs" cljs)
(const :tag "planck" planck)
(const :tag "joker" joker)
diff --git a/test/inf-clojure-tests.el b/test/inf-clojure-tests.el
index bc1951e42d..ffe29d75f8 100644
--- a/test/inf-clojure-tests.el
+++ b/test/inf-clojure-tests.el
@@ -173,7 +173,7 @@ is a string\")
(it "provides all base features for clojure-family REPL types"
(let ((base-features '(load doc source apropos ns-vars set-ns
macroexpand macroexpand-1 arglists)))
- (dolist (repl-type '(clojure babashka node-babashka lein-clr))
+ (dolist (repl-type '(clojure clojure-clr babashka node-babashka
lein-clr))
(dolist (feature base-features)
(expect (inf-clojure--get-feature repl-type feature nil)
:not :to-be nil)))))
@@ -185,10 +185,12 @@ is a string\")
(let ((clj-arglists (inf-clojure--get-feature 'clojure 'arglists nil))
(bb-arglists (inf-clojure--get-feature 'babashka 'arglists nil)))
(expect clj-arglists :to-equal bb-arglists)))
- (it "uses a different arglists catch clause for lein-clr"
+ (it "uses a different arglists catch clause for CLR REPL types"
(let ((clj-arglists (inf-clojure--get-feature 'clojure 'arglists nil))
- (clr-arglists (inf-clojure--get-feature 'lein-clr 'arglists nil)))
+ (clr-arglists (inf-clojure--get-feature 'clojure-clr 'arglists nil))
+ (lein-clr-arglists (inf-clojure--get-feature 'lein-clr 'arglists
nil)))
(expect clj-arglists :not :to-equal clr-arglists)
+ (expect clr-arglists :to-equal lein-clr-arglists)
(expect clr-arglists :to-match "Exception"))))
;;; inf-clojure-tests.el ends here