Function: consult-yank-from-kill-ring
consult-yank-from-kill-ring is an autoloaded, interactive and
byte-compiled function defined in consult.el.
Signature
(consult-yank-from-kill-ring STRING &optional ARG)
Documentation
Select STRING from the kill ring and insert it.
With prefix ARG, put point at beginning, and mark at end, like yank does.
This command behaves like yank-from-kill-ring, which also offers a
completing-read interface to the kill-ring. Additionally the
Consult version supports preview of the selected string.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
;; Adapted from the Emacs `yank-from-kill-ring' function.
;;;###autoload
(defun consult-yank-from-kill-ring (string &optional arg)
"Select STRING from the kill ring and insert it.
With prefix ARG, put point at beginning, and mark at end, like `yank' does.
This command behaves like `yank-from-kill-ring', which also offers a
`completing-read' interface to the `kill-ring'. Additionally the
Consult version supports preview of the selected string."
(interactive (list (consult--read-from-kill-ring) current-prefix-arg))
(when string
(setq yank-window-start (window-start))
(push-mark)
(insert-for-yank string)
(setq this-command 'yank)
(when yank-from-kill-ring-rotate
(if-let* ((pos (seq-position kill-ring string)))
(setq kill-ring-yank-pointer (nthcdr pos kill-ring))
(kill-new string)))
(when (consp arg)
;; Swap point and mark like in `yank'.
(goto-char (prog1 (mark t)
(set-marker (mark-marker) (point) (current-buffer)))))))