summaryrefslogtreecommitdiff
path: root/cider-client.el
diff options
context:
space:
mode:
authorVitalie Spinu <spinuvit@gmail.com>2014-08-06 08:53:42 -0700
committerVitalie Spinu <spinuvit@gmail.com>2014-08-07 14:12:49 -0700
commit19a5e7f14be29ebc93b0fb79bf3e1cedd32c83b9 (patch)
tree797e9ed909e7f090207c3e227ae92ca81d3c63d2 /cider-client.el
parent77a8501f8bc9cf6855501f2ba21d28d4d6aee4c9 (diff)
Refactor and document nrepl-client.el
Refactor: - general code and documentation cleanup - use -- convention for internal function of very limited use - inline several very short internal functions - use systematic naming convention for requests. Namely nrepl-send-request and nrepl-send-sync-request for workhorse functions and `nrepl-request:XXX` and `nrepl-sync-request:OP` for requests of type "OP". - rename `nrepl-send-request-sync` into `nrepl-send-sync-request` - delete `nrepl-log-messages` command Reorganize nrepl-client.el in functional chapters: - Bencode - Client: Process Filter - Client: Initialization - Client: Response Handling - Client: Request Handling - Server - Utilities - Connection Buffer Management - Connection Browser Document the nREPL communication process.
Diffstat (limited to 'cider-client.el')
-rw-r--r--cider-client.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/cider-client.el b/cider-client.el
index d8176311..43720fcd 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -103,7 +103,7 @@ NS & SESSION specify the context in which to evaluate the request."
(not (string= ns nrepl-buffer-ns))
(not (cider-ns-form-p input)))
(cider-eval-ns-form))
- (nrepl-send-string input callback ns session)))
+ (nrepl-request:eval input callback ns session)))
(defun cider-tooling-eval (input callback &optional ns)
"Send the request INPUT and register the CALLBACK as the response handler.
@@ -114,7 +114,7 @@ NS specifies the namespace in which to evaluate the request."
(defun cider-eval-sync (input &optional ns session)
"Send the INPUT to the nREPL server synchronously.
NS & SESSION specify the evaluation context."
- (nrepl-send-string-sync input ns session))
+ (nrepl-sync-request:eval input ns session))
(defun cider-eval-and-get-value (input &optional ns session)
"Send the INPUT to the nREPL server synchronously and return the value.
@@ -160,7 +160,7 @@ loaded."
(interactive)
(let ((pending-request-ids (cider-util--hash-keys nrepl-pending-requests)))
(dolist (request-id pending-request-ids)
- (nrepl-send-interrupt request-id (cider-interrupt-handler (current-buffer))))))
+ (nrepl-request:interrupt request-id (cider-interrupt-handler (current-buffer))))))
(defun cider-current-repl-buffer ()
"The current REPL buffer."
@@ -204,7 +204,7 @@ contain a `candidates' key, it is returned as is."
When multiple matching vars are returned you'll be prompted to select one,
unless ALL is truthy."
(when (and var (not (string= var "")))
- (let ((val (plist-get (nrepl-send-request-sync
+ (let ((val (plist-get (nrepl-send-sync-request
(list "op" "info"
"session" (nrepl-current-session)
"ns" (cider-current-ns)
@@ -218,7 +218,7 @@ unless ALL is truthy."
(defun cider-member-info (class member)
"Return the CLASS MEMBER's info as an alist with list cdrs."
(when (and class member)
- (let ((val (plist-get (nrepl-send-request-sync
+ (let ((val (plist-get (nrepl-send-sync-request
(list "op" "info"
"session" (nrepl-current-session)
"class" class