Function: cider-eval-print-with-comment-handler

cider-eval-print-with-comment-handler is a byte-compiled function defined in cider-eval.el.

Signature

(cider-eval-print-with-comment-handler BUFFER LOCATION COMMENT-PREFIX)

Documentation

Make a handler for evaluating and printing commented results in BUFFER.

LOCATION is the location marker at which to insert. COMMENT-PREFIX is the comment prefix to use.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-eval.el
(defun cider-eval-print-with-comment-handler (buffer location comment-prefix)
  "Make a handler for evaluating and printing commented results in BUFFER.
LOCATION is the location marker at which to insert.  COMMENT-PREFIX is the
comment prefix to use."
  (let ((res ""))
    (nrepl-make-response-handler buffer
                                 (lambda (_buffer value)
                                   (setq res (concat res value)))
                                 (lambda (_buffer out)
                                   (cider-emit-interactive-eval-output out))
                                 (lambda (_buffer err)
                                   (cider-emit-interactive-eval-err-output err))
                                 (lambda (buffer)
                                   (with-current-buffer buffer
                                     (save-excursion
                                       (goto-char (marker-position location))
                                       (insert (concat comment-prefix
                                                       res "\n"))))
                                   (when cider-eval-register
                                     (set-register cider-eval-register res))))))