Next: , Previous: Repeat Isearch, Up: Incremental Search

15.1.3 Isearch Yanking

In many cases, you will want to use text at or near point as your search string. The commands described in this subsection let you do that conveniently.

C-w (isearch-yank-word-or-char) appends the next character or word at point to the search string. This is an easy way to search for another occurrence of the text at point. (The decision of whether to copy a character or a word is heuristic.)

Similarly, M-s C-e (isearch-yank-line) appends the rest of the current line to the search string. If point is already at the end of a line, it appends the next line. With a prefix argument n, it appends the next n lines.

Within incremental search, C-y (isearch-yank-kill) appends the current kill to the search string. M-y (isearch-yank-pop), if called after C-y, replaces that appended text with an earlier kill, similar to the usual M-y (yank-pop) command (see Yanking). Clicking mouse-2 in the echo area appends the current X selection (see Primary Selection) to the search string (isearch-yank-x-selection).

C-M-w (isearch-del-char) deletes the last character from the search string, and C-M-y (isearch-yank-char) appends the character after point to the search string. An alternative method to add the character after point is to enter the minibuffer with M-e (see Repeat Isearch) and type C-f or <RIGHT> at the end of the search string in the minibuffer. Each C-f or <RIGHT> you type adds another character following point to the search string.

Normally, when the search is case-insensitive, text yanked into the search string is converted to lower case, so that the search remains case-insensitive (see case folding). However, if the value of the variable search-upper-case (see search-upper-case) is other than not-yanks, that disables this down-casing.