Function: cider-repl-history-do-insert
cider-repl-history-do-insert is a byte-compiled function defined in
cider-repl-history.el.
Signature
(cider-repl-history-do-insert BUF PT)
Documentation
Helper function to insert text from BUF at PT into the REPL buffer.
Also kills *cider-repl-history*.
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-repl-history.el
(defun cider-repl-history-do-insert (_buf pt)
"Helper function to insert text from BUF at PT into the REPL buffer.
Also kills *cider-repl-history*."
;; Note: as mentioned at the top, this file is based on browse-kill-ring,
;; which has numerous insertion options. The functionality of
;; browse-kill-ring allows users to insert at point, and move point to the end
;; of the inserted text; or insert at the beginning or end of the buffer,
;; while leaving point alone. And each of these had the option of leaving the
;; history buffer in place, or getting rid of it. That was appropriate for a
;; generic paste tool, but for inserting a previous command into an
;; interpreter, I felt the only useful option would be inserting it at the end
;; and quitting the history buffer, so that is all that's provided.
(let ((str (cider-repl-history-current-string pt)))
(cider-repl-history-quit)
(with-selected-window cider-repl-history-repl-window
(with-current-buffer cider-repl-history-repl-buffer
(let ((max (point-max)))
(if (= max (point))
(cider-repl-history-insert-and-highlight str)
(save-excursion
(goto-char max)
(cider-repl-history-insert-and-highlight str))))))))