Function: isearch-yank-pop-only

isearch-yank-pop-only is an interactive and byte-compiled function defined in isearch.el.gz.

Signature

(isearch-yank-pop-only &optional ARG)

Documentation

Replace just-yanked search string with previously killed string.

Unlike isearch-yank-pop, when this command is called not immediately after a isearch-yank-kill or a isearch-yank-pop-only, it only pops the last killed string instead of activating the minibuffer to read a string from the kill-ring as yank-pop does. The prefix arg C-u (universal-argument) always reads a string from the kill-ring using the minibuffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/isearch.el.gz
(defun isearch-yank-pop-only (&optional arg)
  "Replace just-yanked search string with previously killed string.
Unlike `isearch-yank-pop', when this command is called not immediately
after a `isearch-yank-kill' or a `isearch-yank-pop-only', it only pops
the last killed string instead of activating the minibuffer to read
a string from the `kill-ring' as `yank-pop' does.  The prefix arg \\[universal-argument]
always reads a string from the `kill-ring' using the minibuffer."
  (interactive "P")
  (cond
   ((equal arg '(4))
    (isearch-yank-from-kill-ring))
   ((not (memq last-command '(isearch-yank-kill
                              isearch-yank-pop isearch-yank-pop-only)))
    ;; Fall back on `isearch-yank-kill' for the benefits of people
    ;; who are used to the old behavior of `M-y' in isearch mode.
    ;; In future, `M-y' could be changed from `isearch-yank-pop-only'
    ;; to `isearch-yank-pop' that uses the kill-ring-browser.
    (isearch-yank-kill))
   (t
    (isearch-pop-state)
    (isearch-yank-string (current-kill 1)))))