Function: cider-eval-defun-to-comment

cider-eval-defun-to-comment is an interactive and byte-compiled function defined in cider-eval.el.

Signature

(cider-eval-defun-to-comment &optional INSERT-BEFORE)

Documentation

Evaluate the "top-level" form and insert result as comment.

The formatting of the comment is defined in cider-comment-prefix which, by default, is ";; => " and can be customized.

With the prefix arg INSERT-BEFORE, insert before the form, otherwise afterwards.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-eval.el
(defun cider-eval-defun-to-comment (&optional insert-before)
  "Evaluate the \"top-level\" form and insert result as comment.

The formatting of the comment is defined in `cider-comment-prefix'
which, by default, is \";; => \" and can be customized.

With the prefix arg INSERT-BEFORE, insert before the form, otherwise afterwards."
  (interactive "P")
  (let* ((bounds (cider-defun-at-point 'bounds))
         (insertion-point (nth (if insert-before 0 1) bounds)))
    (cider-interactive-eval nil
                            (cider-eval-print-with-comment-handler
                             (current-buffer)
                             (set-marker (make-marker) insertion-point)
                             cider-comment-prefix)
                            bounds
                            (cider--nrepl-pr-request-plist))))