annotate man/xemacs/regs.texi @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @node Registers, Display, Rectangles, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @chapter Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @cindex registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 Emacs @dfn{registers} are places in which you can save text or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 positions for later use. Text saved in a register can be copied into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 the buffer once or many times; a position saved in a register is used by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 moving point to that position. Rectangles can also be copied into and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 out of registers (@pxref{Rectangles}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 Each register has a name, which is a single character. A register can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 store either a piece of text, a position, or a rectangle, but only one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 thing at any given time. Whatever you store in a register remains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 there until you store something else in that register.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 * RegPos:: Saving positions in registers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 * RegText:: Saving text in registers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 * RegRect:: Saving rectangles in registers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @item M-x view-register @key{RET} @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 Display a description of what register @var{r} contains.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 @findex view-register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 @kbd{M-x view-register} reads a register name as an argument and then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 displays the contents of the specified register.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 @node RegPos, RegText, Registers, Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 @section Saving Positions in Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 Saving a position records a spot in a buffer so you can move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 back there later. Moving to a saved position re-selects the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 and moves point to the spot.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 @item C-x r SPC @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 Save the location of point in register @var{r} (@code{point-to-register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 @item C-x r j @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 Jump to the location saved in register @var{r} (@code{register-to-point}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @kindex C-x r SPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 @findex point-to-register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 To save the current location of point in a register, choose a name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 @var{r} and type @kbd{C-x r SPC @var{r}}. The register @var{r} retains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 the location thus saved until you store something else in that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 register.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @kindex C-x r j
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @findex register-to-point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 The command @kbd{C-x r j @var{r}} moves point to the location recorded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 in register @var{r}. The register is not affected; it continues to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 record the same location. You can jump to the same position using the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 same register as often as you want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 @node RegText, RegRect, RegPos, Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 @section Saving Text in Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 When you want to insert a copy of the same piece of text many times, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 can be impractical to use the kill ring, since each subsequent kill moves
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 the piece of text further down on the ring. It becomes hard to keep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 track of the argument needed to retrieve the same text with @kbd{C-y}. An
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 alternative is to store the text in a register with @kbd{C-x r s}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (@code{copy-to-register}) and then retrieve it with @kbd{C-x r g}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (@code{insert-register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 @item C-x r s @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 Copy region into register @var{r} (@code{copy-to-register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 @item C-x r g @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 Insert text contents of register @var{r} (@code{insert-register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 @kindex C-x r s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 @kindex C-x r g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 @findex copy-to-register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 @findex insert-register
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 @kbd{C-x r s @var{r}} stores a copy of the text of the region into the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 register named @var{r}. Given a numeric argument, @kbd{C-x r s} deletes the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 text from the buffer as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @kbd{C-x r g @var{r}} inserts the text from register @var{r} in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 By default it leaves point before the text and places the mark after it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 With a numeric argument, it puts point after the text and the mark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 before it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @node RegRect,, RegText, Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @section Saving Rectangles in Registers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 @cindex rectangle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 @findex copy-region-to-rectangle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 A register can contain a rectangle instead of lines of text. The rectangle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 is represented as a list of strings. @xref{Rectangles}, for basic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 information on rectangles and how to specify rectangles in a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 @item C-x r r @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 Copy the region-rectangle into register @var{r}(@code{copy-rectangle-to-register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 With a numeric argument, delete it as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 @item C-x r g @var{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 Insert the rectangle stored in register @var{r} (if it contains a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 rectangle) (@code{insert-register}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 The @kbd{C-x r g} command inserts linear text if the register contains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 that, or inserts a rectangle if the register contains one.