Function: cider-nrepl-request:eval

cider-nrepl-request:eval is a byte-compiled function defined in cider-client.el.

Signature

(cider-nrepl-request:eval INPUT CALLBACK &optional NS LINE COLUMN ADDITIONAL-PARAMS CONNECTION)

Documentation

Send the request INPUT and register the CALLBACK as the response handler.

If NS is non-nil, include it in the request. LINE and COLUMN, if non-nil, define the position of INPUT in its buffer. ADDITIONAL-PARAMS is a plist to be appended to the request message. CONNECTION is the connection buffer, defaults to (cider-current-repl).

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-client.el
(defun cider-nrepl-request:eval (input callback &optional ns line column additional-params connection)
  "Send the request INPUT and register the CALLBACK as the response handler.
If NS is non-nil, include it in the request.  LINE and COLUMN, if non-nil,
define the position of INPUT in its buffer.  ADDITIONAL-PARAMS is a plist
to be appended to the request message.  CONNECTION is the connection
buffer, defaults to (cider-current-repl)."
  (let ((connection (or connection (cider-current-repl 'infer 'ensure)))
        (eval-buffer (current-buffer)))
    (run-hooks 'cider-before-eval-hook)
    (nrepl-request:eval input
                        (lambda (response)
                          (when cider-show-spinner
                            (cider-eval-spinner connection response))
                          (when (and (buffer-live-p eval-buffer)
                                     (member "done" (nrepl-dict-get response "status")))
                            (with-current-buffer eval-buffer
                              (run-hooks 'cider-after-eval-done-hook)))
                          (funcall callback response))
                        connection
                        ns line column additional-params)
    (cider-spinner-start connection)))