Function: cider-eval-sexp-up-to-point
cider-eval-sexp-up-to-point is an interactive and byte-compiled
function defined in cider-eval.el.
Signature
(cider-eval-sexp-up-to-point &optional OUTPUT-TO-CURRENT-BUFFER)
Documentation
Evaluate the current sexp form up to point.
If invoked with OUTPUT-TO-CURRENT-BUFFER, print the result in the current buffer. It constructs an expression to eval in the following manner:
- It finds the code between the point and the start of the sexp expression;
- It balances this bit of code by closing the expression;
- It evaluates the resulting code using cider-interactive-eval.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-eval.el
(defun cider-eval-sexp-up-to-point (&optional output-to-current-buffer)
"Evaluate the current sexp form up to point.
If invoked with OUTPUT-TO-CURRENT-BUFFER, print the result in the current
buffer. It constructs an expression to eval in the following manner:
- It finds the code between the point and the start of the sexp expression;
- It balances this bit of code by closing the expression;
- It evaluates the resulting code using `cider-interactive-eval'."
(interactive "P")
(let* ((beg-of-sexp (save-excursion (up-list) (backward-list) (point)))
(beg-delimiter (save-excursion (up-list) (backward-list) (char-after)))
(beg-set? (save-excursion (up-list) (backward-list) (char-before)))
(code (buffer-substring-no-properties beg-of-sexp (point)))
(code (if (= beg-set? ?#) (concat (list beg-set?) code) code))
(code (concat code (list (cider--matching-delimiter beg-delimiter)))))
(cider-interactive-eval code
(when output-to-current-buffer
(cider-eval-print-handler))
(list beg-of-sexp (point))
(cider--nrepl-pr-request-plist))))