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 &optional COMMENT-POSTFIX)

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 and COMMENT-POSTFIX (if any) is appended after the result.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-eval.el
(defun cider-eval-print-with-comment-handler (buffer location comment-prefix &optional comment-postfix)
  "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 and COMMENT-POSTFIX (if any) is appended after the
result."
  (let ((res "")
        (location (copy-marker location)))
    (cider-make-eval-handler
     :buffer buffer
     :on-value (lambda (value) (setq res (concat res value)))
     :on-stdout #'cider-emit-interactive-eval-output
     :on-stderr #'cider-emit-interactive-eval-err-output
     :on-done (lambda ()
                (with-current-buffer buffer
                  (save-excursion
                    (goto-char (marker-position location))
                    (insert (concat comment-prefix res (or comment-postfix "") "\n"))))
                (cider--maybe-set-eval-register res)))))