aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-08-17 14:55:43 +0000
committerChong Yidong2008-08-17 14:55:43 +0000
commitd0ca439dcbb39d34a17ae4812d7ed4cfd071d9aa (patch)
tree6e87ecd1bd1d504c0d3876dcd3f8d920f77b2638
parent39ee1d04275913442430672516b3413240d6abe4 (diff)
downloademacs-d0ca439dcbb39d34a17ae4812d7ed4cfd071d9aa.tar.gz
emacs-d0ca439dcbb39d34a17ae4812d7ed4cfd071d9aa.zip
(Registers): Clarify valid register names.
(RegPos): Note that buffer is saved and restored too. (RegText): Note that mark is reactivated/deactivated. (RegConfig): Xref to Windows node.
-rw-r--r--doc/emacs/regs.texi80
1 files changed, 43 insertions, 37 deletions
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi
index 6be26123a65..f42692d7b4c 100644
--- a/doc/emacs/regs.texi
+++ b/doc/emacs/regs.texi
@@ -9,16 +9,20 @@
9 Emacs @dfn{registers} are compartments where you can save text, 9 Emacs @dfn{registers} are compartments where you can save text,
10rectangles, positions, and other things for later use. Once you save 10rectangles, positions, and other things for later use. Once you save
11text or a rectangle in a register, you can copy it into the buffer 11text or a rectangle in a register, you can copy it into the buffer
12once, or many times; you can move point to a position saved in a 12once, or many times; once you save a position in a register, you can
13register once, or many times. 13jump back to that position once, or many times.
14
15 Each register has a name that consists of a single character, which
16we will denote by @var{r}; @var{r} can be a letter (such as @samp{a})
17or a number (such as @samp{1}); case matters, so register @samp{a} is
18not the same as register @samp{A}.
14 19
15@findex view-register 20@findex view-register
16 Each register has a name, which consists of a single character. A 21 A register can store a position, a piece of text, a rectangle, a
17register can store a number, a piece of text, a rectangle, a position, 22number, a window configuration, or a file name, but only one thing at
18a window configuration, or a file name, but only one thing at any 23any given time. Whatever you store in a register remains there until
19given time. Whatever you store in a register remains there until you 24you store something else in that register. To see what register
20store something else in that register. To see what a register @var{r} 25@var{r} contains, use @kbd{M-x view-register}:
21contains, use @kbd{M-x view-register}.
22 26
23@table @kbd 27@table @kbd
24@item M-x view-register @key{RET} @var{r} 28@item M-x view-register @key{RET} @var{r}
@@ -44,30 +48,28 @@ seem to belong in this chapter.
44@section Saving Positions in Registers 48@section Saving Positions in Registers
45@cindex saving position in a register 49@cindex saving position in a register
46 50
47 Saving a position records a place in a buffer so that you can move
48back there later. Moving to a saved position switches to that buffer
49and moves point to that place in it.
50
51@table @kbd 51@table @kbd
52@item C-x r @key{SPC} @var{r} 52@item C-x r @key{SPC} @var{r}
53Save position of point in register @var{r} (@code{point-to-register}). 53Record the position of point and the current buffer in register
54@var{r} (@code{point-to-register}).
54@item C-x r j @var{r} 55@item C-x r j @var{r}
55Jump to the position saved in register @var{r} (@code{jump-to-register}). 56Jump to the position and buffer saved in register @var{r}
57(@code{jump-to-register}).
56@end table 58@end table
57 59
58@kindex C-x r SPC 60@kindex C-x r SPC
59@findex point-to-register 61@findex point-to-register
60 To save the current position of point in a register, choose a name 62 Typing @kbd{C-x r @key{SPC}} (@code{point-to-register}), followed by
61@var{r} and type @kbd{C-x r @key{SPC} @var{r}}. The register @var{r} 63a character @kbd{@var{r}}, saves both the position of point and the
62retains the position thus saved until you store something else in that 64current buffer in register @var{r}. The register retains this
63register. 65information until you store something else in it.
64 66
65@kindex C-x r j 67@kindex C-x r j
66@findex jump-to-register 68@findex jump-to-register
67 The command @kbd{C-x r j @var{r}} moves point to the position recorded 69 The command @kbd{C-x r j @var{r}} switches to the buffer recorded in
68in register @var{r}. The register is not affected; it continues to 70register @var{r}, and moves point to the recorded position. The
69hold the same position. You can jump to the saved position any number 71contents of the register are not changed, so you can jump to the saved
70of times. 72position any number of times.
71 73
72 If you use @kbd{C-x r j} to go to a saved position, but the buffer it 74 If you use @kbd{C-x r j} to go to a saved position, but the buffer it
73was saved from has been killed, @kbd{C-x r j} tries to create the buffer 75was saved from has been killed, @kbd{C-x r j} tries to create the buffer
@@ -95,24 +97,27 @@ Prepend region to text in register @var{r}.
95@end table 97@end table
96 98
97@kindex C-x r s 99@kindex C-x r s
98@kindex C-x r i
99@findex copy-to-register 100@findex copy-to-register
100@findex insert-register
101 @kbd{C-x r s @var{r}} stores a copy of the text of the region into 101 @kbd{C-x r s @var{r}} stores a copy of the text of the region into
102the register named @var{r}. @kbd{C-u C-x r s @var{r}}, the same 102the register named @var{r}. If the mark is inactive, Emacs first
103command with a numeric argument, deletes the text from the buffer as 103reactivates the mark where it was last set. The mark is deactivated
104well; you can think of this as ``moving'' the region text into the register. 104at the end of this command. @xref{Mark}. @kbd{C-u C-x r s @var{r}},
105the same command with a prefix argument, copies the text into register
106@var{r} and deletes the text from the buffer as well; you can think of
107this as ``moving'' the region text into the register.
105 108
106@findex append-to-register 109@findex append-to-register
107@findex prepend-to-register 110@findex prepend-to-register
108 @kbd{M-x append-to-register @key{RET} @var{r}} appends the copy of 111 @kbd{M-x append-to-register @key{RET} @var{r}} appends the copy of
109the text in the region to the text already stored in the register 112the text in the region to the text already stored in the register
110named @var{r}. If invoked with a numeric argument, it deletes the 113named @var{r}. If invoked with a prefix argument, it deletes the
111region after appending it to the register. The command 114region after appending it to the register. The command
112@code{prepend-to-register} is similar, except that it @emph{prepends} 115@code{prepend-to-register} is similar, except that it @emph{prepends}
113the region text to the text in the register, rather than 116the region text to the text in the register instead of
114@emph{appending} it. 117@emph{appending} it.
115 118
119@kindex C-x r i
120@findex insert-register
116 @kbd{C-x r i @var{r}} inserts in the buffer the text from register 121 @kbd{C-x r i @var{r}} inserts in the buffer the text from register
117@var{r}. Normally it leaves point before the text and places the mark 122@var{r}. Normally it leaves point before the text and places the mark
118after, but with a numeric argument (@kbd{C-u}) it puts point after the 123after, but with a numeric argument (@kbd{C-u}) it puts point after the
@@ -122,9 +127,9 @@ text and the mark before.
122@section Saving Rectangles in Registers 127@section Saving Rectangles in Registers
123@cindex saving rectangle in a register 128@cindex saving rectangle in a register
124 129
125 A register can contain a rectangle instead of linear text. The 130 A register can contain a rectangle instead of linear text.
126rectangle is represented as a list of strings. @xref{Rectangles}, for 131@xref{Rectangles}, for basic information on how to specify a rectangle
127basic information on how to specify a rectangle in the buffer. 132in the buffer.
128 133
129@table @kbd 134@table @kbd
130@findex copy-rectangle-to-register 135@findex copy-rectangle-to-register
@@ -155,7 +160,8 @@ as sorting a rectangle. @xref{Sorting}.
155@kindex C-x r f 160@kindex C-x r f
156 You can save the window configuration of the selected frame in a 161 You can save the window configuration of the selected frame in a
157register, or even the configuration of all windows in all frames, and 162register, or even the configuration of all windows in all frames, and
158restore the configuration later. 163restore the configuration later. @xref{Windows}, for information
164about window configurations.
159 165
160@table @kbd 166@table @kbd
161@item C-x r w @var{r} 167@item C-x r w @var{r}
@@ -283,10 +289,10 @@ default bookmark file automatically. This saving and loading is how
283bookmarks persist from one Emacs session to the next. 289bookmarks persist from one Emacs session to the next.
284 290
285@vindex bookmark-save-flag 291@vindex bookmark-save-flag
286 If you set the variable @code{bookmark-save-flag} to 1, then each 292 If you set the variable @code{bookmark-save-flag} to 1, each command
287command that sets a bookmark will also save your bookmarks; this way, 293that sets a bookmark will also save your bookmarks; this way, you
288you don't lose any bookmark values even if Emacs crashes. (The value, 294don't lose any bookmark values even if Emacs crashes. (The value, if
289if a number, says how many bookmark modifications should go by between 295a number, says how many bookmark modifications should go by between
290saving.) 296saving.)
291 297
292@vindex bookmark-search-size 298@vindex bookmark-search-size