Next: , Previous: , Up: Registers   [Contents][Index]


10.2 Saving Text in Registers

When you want to insert a copy of the same piece of text many times, it can be impractical to use the kill ring, since each subsequent kill moves the piece of text further down on the ring. It becomes hard to keep track of the argument needed to retrieve the same text with C-y. An alternative is to store the text in a register with C-x r s (copy-to-register) and then retrieve it with C-x r i (insert-register).

C-x r s r

Copy region into register r (copy-to-register).

C-x r g r
C-x r i r

Insert text contents of register r (insert-register).

C-x r s r stores a copy of the text of the region into the register named r. Given a numeric argument, C-x r s r deletes the text from the buffer as well.

C-x r i r inserts the text from register r in the buffer. By default it leaves point before the text and places the mark after it. With a numeric argument (C-u), it puts point after the text and the mark before it.