[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Emacs registers are places in which you can save text or positions for later use. Text saved in a register can be copied into the buffer once or many times; a position saved in a register is used by moving point to that position. Rectangles can also be copied into and out of registers (@pxref{Rectangles}).
Each register has a name, which is a single character. A register can store either a piece of text, a position, or a rectangle, but only one thing at any given time. Whatever you store in a register remains there until you store something else in that register.
1.1 Saving Positions in Registers | Saving positions in registers. | |
1.2 Saving Text in Registers | Saving text in registers. | |
1.3 Saving Rectangles in Registers | Saving rectangles in registers. |
Display a description of what register r contains.
M-x view-register reads a register name as an argument and then displays the contents of the specified register.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Saving a position records a spot in a buffer so you can move back there later. Moving to a saved position re-selects the buffer and moves point to the spot.
Save the location of point in register r (point-to-register
).
Jump to the location saved in register r (register-to-point
).
To save the current location of point in a register, choose a name r and type C-x r SPC r. The register r retains the location thus saved until you store something else in that register.
The command C-x r j r moves point to the location recorded in register r. The register is not affected; it continues to record the same location. You can jump to the same position using the same register as often as you want.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 g
(insert-register
).
Copy region into register r (copy-to-register
).
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 deletes the text from the buffer as well.
C-x r g 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, it puts point after the text and the mark before it.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A register can contain a rectangle instead of lines of text. The rectangle is represented as a list of strings. @xref{Rectangles}, for basic information on rectangles and how to specify rectangles in a buffer.
Copy the region-rectangle into register r(copy-rectangle-to-register
).
With a numeric argument, delete it as well.
Insert the rectangle stored in register r (if it contains a
rectangle) (insert-register
).
The C-x r g command inserts linear text if the register contains that, or inserts a rectangle if the register contains one.
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 6, 2024 using texi2html 5.0.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
[ < ] | Back | Previous section in reading order | 1.2.2 |
[ Up ] | Up | Up section | 1.2 |
[ > ] | Forward | Next section in reading order | 1.2.4 |
[ >> ] | FastForward | Next chapter | 2 |
[Top] | Top | Cover (top) of document | |
[Contents] | Contents | Table of contents | |
[Index] | Index | Index | |
[ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on December 6, 2024 using texi2html 5.0.