summaryrefslogtreecommitdiff
path: root/cider-client.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2018-03-05 10:47:01 +0700
committerBozhidar Batsov <bozhidar@batsov.com>2018-03-05 10:47:01 +0700
commit462ad81fcf0879ea78975f8656066a4f966f610f (patch)
tree76d4874fd83fcccc486321a885f868bbbfd777b1 /cider-client.el
parent6aadcd8b6dc263ae91f53272efed0d6d084139af (diff)
Add cider-sync-tooling-eval
Diffstat (limited to 'cider-client.el')
-rw-r--r--cider-client.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/cider-client.el b/cider-client.el
index 5e1e874c..76833b7e 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -782,7 +782,11 @@ result, and is included in the request if non-nil."
(defun cider-tooling-eval (input callback &optional ns)
"Send the request INPUT and register the CALLBACK as the response handler.
-NS specifies the namespace in which to evaluate the request."
+NS specifies the namespace in which to evaluate the request.
+
+Requests evaluated in the tooling nREPL session don't affect the
+thread-local bindings of the primary eval nREPL session (e.g. this is not
+going to clobber *1/2/3)."
;; namespace forms are always evaluated in the "user" namespace
(nrepl-request:eval input
callback
@@ -790,6 +794,20 @@ NS specifies the namespace in which to evaluate the request."
ns nil nil nil t ; tooling
))
+(defun cider-sync-tooling-eval (input &optional ns)
+ "Send the request INPUT and evaluate in synchronously.
+NS specifies the namespace in which to evaluate the request.
+
+Requests evaluated in the tooling nREPL session don't affect the
+thread-local bindings of the primary eval nREPL session (e.g. this is not
+going to clobber *1/2/3)."
+ ;; namespace forms are always evaluated in the "user" namespace
+ (nrepl-sync-request:eval input
+ (cider-current-connection)
+ ns
+ t ; tooling
+ ))
+
(defalias 'cider-current-repl-buffer #'cider-current-connection
"The current REPL buffer.
Return the REPL buffer given by `cider-current-connection'.")