Function: cider-nrepl-send-eval-request

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

Signature

(cider-nrepl-send-eval-request INPUT CALLBACK &key 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).

This is the keyword-argument form; cider-nrepl-request:eval is the legacy positional shim retained for backward compatibility.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260807.1133/cider-client.el
(cl-defun cider-nrepl-send-eval-request (input callback
                                               &key 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).

This is the keyword-argument form; `cider-nrepl-request:eval' is the legacy
positional shim retained for backward compatibility."
  (let ((connection (or connection (cider-current-repl 'infer 'ensure)))
        ;; Show the spinner in the buffer the evaluation was initiated from
        ;; (the source buffer, or the REPL when evaluating at its prompt),
        ;; rather than always in the REPL, which is often not even visible.
        (eval-buffer (current-buffer)))
    (run-hooks 'cider-before-eval-hook)
    (nrepl-send-eval-request input
                             (lambda (response)
                               (when cider-show-spinner
                                 (cider-eval-spinner eval-buffer 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 ns :line line :column column
                             :additional-params additional-params)
    (unless cider--eval-spinner-inhibit-mode-line
      (cider-spinner-start eval-buffer))))