Next: , Up: Yanking


13.1 The Kill Ring

All killed text is recorded in the kill ring, a list of blocks of text that have been killed. There is only one kill ring, shared by all buffers, so you can kill text in one buffer and yank it in another buffer. This is the usual way to move text from one file to another. (There are several other methods: for instance, you could store the text in a register. See Registers, for information about registers. See Accumulating Text, for some other ways to move text around.)

The command C-y (yank) reinserts the text of the most recent kill, leaving the cursor at the end of the text. It also adds the position of the beginning of the text to the mark ring, without activating the mark; this allows you to jump easily to that position with C-x C-x (see Setting Mark). With a plain prefix argument (C-u C-y), it instead leaves the cursor in front of the text, and adds the position of the end of the text to the mark ring. Using other sort of prefix argument specifies an earlier kill; for example, C-u 4 C-y reinserts the fourth most recent kill. See Earlier Kills.

The yank commands discard certain properties from the yanked text. These are properties that might lead to annoying results, such as causing the text to respond to the mouse or specifying key bindings. The list of properties to discard is stored in the variable yank-excluded-properties. Yanking of register contents and rectangles also discard these properties. See Text Properties, for more information about text properties.