Function: consult--read-from-kill-ring

consult--read-from-kill-ring is a natively compiled function defined in consult.el.

Signature

(consult--read-from-kill-ring)

Documentation

Open kill ring menu and return selected string.

Source Code

;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
;;;;; Command: consult-yank

(defun consult--read-from-kill-ring ()
  "Open kill ring menu and return selected string."
  ;; `current-kill' updates `kill-ring' with interprogram paste, see
  ;; gh:minad/consult#443.
  (current-kill 0)
  (consult--read
   (consult--remove-dups
    (or (if yank-from-kill-ring-rotate
            (append kill-ring-yank-pointer
                    (butlast kill-ring (length kill-ring-yank-pointer)))
          kill-ring)
        (user-error "Kill ring is empty")))
   :prompt "Yank from kill-ring: "
   :history t ;; disable history
   :sort nil
   :category 'kill-ring
   :require-match t
   :lookup #'consult--lookup-member
   :state
   (consult--insertion-preview
    (point)
    ;; If previous command is yank, hide previously yanked string
    (or (and (eq last-command 'yank) (mark t)) (point)))))