Function: cider-send-to-comment
cider-send-to-comment is an interactive and byte-compiled function
defined in cider-eval.el.
Signature
(cider-send-to-comment &optional EVAL)
Documentation
Copy the top-level form at point into the namespace's rich comment block.
The form is appended to the last top-level comment form in the buffer,
creating one at the end of the buffer when none exists. Point stays where it
is; use cider-jump-to-comment to visit the block.
With a prefix arg EVAL, also evaluate the form and insert its result beneath
it, honoring cider-comment-style.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-eval.el
(defun cider-send-to-comment (&optional eval)
"Copy the top-level form at point into the namespace's rich `comment' block.
The form is appended to the last top-level `comment' form in the buffer,
creating one at the end of the buffer when none exists. Point stays where it
is; use `cider-jump-to-comment' to visit the block.
With a prefix arg EVAL, also evaluate the form and insert its result beneath
it, honoring `cider-comment-style'."
(interactive "P")
(let ((form (cider-defun-at-point)))
(when (or (null form) (string-blank-p form))
(user-error "No top-level form at point"))
;; leave point undisturbed; the eval result lands via the END marker, not
;; at point, so filing a form away never moves the user
(save-excursion
(pcase-let* ((`(,_beg . ,end) (cider--insert-in-comment form))
(`(,prefix ,continued ,postfix) (cider--comment-format)))
(when eval
(cider-interactive-eval
(string-trim form)
(cider-eval-pprint-with-multiline-comment-handler
(current-buffer) end prefix continued postfix)
nil
(cider--nrepl-print-request-plist fill-column)))))))