annotate man/regs.texi @ 34187:e2fb02d21aee

Remove erroneous spec for condition-case.
author Dave Love <fx@gnu.org>
date Mon, 04 Dec 2000 17:05:57 +0000
parents ac7e9e5e2ccb
children 6cd5aaf1a361
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
1 @c This is part of the Emacs manual.
Dave Love <fx@gnu.org>
parents:
diff changeset
2 @c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
Dave Love <fx@gnu.org>
parents:
diff changeset
3 @c See file emacs.texi for copying conditions.
Dave Love <fx@gnu.org>
parents:
diff changeset
4 @node Registers, Display, Rectangles, Top
Dave Love <fx@gnu.org>
parents:
diff changeset
5 @chapter Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
6 @cindex registers
Dave Love <fx@gnu.org>
parents:
diff changeset
7
Dave Love <fx@gnu.org>
parents:
diff changeset
8 Emacs @dfn{registers} are places you can save text or positions for
Dave Love <fx@gnu.org>
parents:
diff changeset
9 later use. Once you save text or a rectangle in a register, you can
Dave Love <fx@gnu.org>
parents:
diff changeset
10 copy it into the buffer once or many times; you can move point to a
Dave Love <fx@gnu.org>
parents:
diff changeset
11 position saved in a register once or many times.
Dave Love <fx@gnu.org>
parents:
diff changeset
12
Dave Love <fx@gnu.org>
parents:
diff changeset
13 @findex view-register
Dave Love <fx@gnu.org>
parents:
diff changeset
14 Each register has a name which is a single character. A register can
Dave Love <fx@gnu.org>
parents:
diff changeset
15 store a piece of text, a rectangle, a position, a window configuration,
Dave Love <fx@gnu.org>
parents:
diff changeset
16 or a file name, but only one thing at any given time. Whatever you
Dave Love <fx@gnu.org>
parents:
diff changeset
17 store in a register remains there until you store something else in that
Dave Love <fx@gnu.org>
parents:
diff changeset
18 register. To see what a register @var{r} contains, use @kbd{M-x
Dave Love <fx@gnu.org>
parents:
diff changeset
19 view-register}.
Dave Love <fx@gnu.org>
parents:
diff changeset
20
Dave Love <fx@gnu.org>
parents:
diff changeset
21 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
22 @item M-x view-register @key{RET} @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
23 Display a description of what register @var{r} contains.
Dave Love <fx@gnu.org>
parents:
diff changeset
24 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
25
Dave Love <fx@gnu.org>
parents:
diff changeset
26 @menu
Dave Love <fx@gnu.org>
parents:
diff changeset
27 * Position: RegPos. Saving positions in registers.
Dave Love <fx@gnu.org>
parents:
diff changeset
28 * Text: RegText. Saving text in registers.
Dave Love <fx@gnu.org>
parents:
diff changeset
29 * Rectangle: RegRect. Saving rectangles in registers.
Dave Love <fx@gnu.org>
parents:
diff changeset
30 * Configurations: RegConfig. Saving window configurations in registers.
Dave Love <fx@gnu.org>
parents:
diff changeset
31 * Files: RegFiles. File names in registers.
Dave Love <fx@gnu.org>
parents:
diff changeset
32 * Numbers: RegNumbers. Numbers in registers.
Dave Love <fx@gnu.org>
parents:
diff changeset
33 * Bookmarks:: Bookmarks are like registers, but persistent.
Dave Love <fx@gnu.org>
parents:
diff changeset
34 @end menu
Dave Love <fx@gnu.org>
parents:
diff changeset
35
Dave Love <fx@gnu.org>
parents:
diff changeset
36 @node RegPos
Dave Love <fx@gnu.org>
parents:
diff changeset
37 @section Saving Positions in Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
38
Dave Love <fx@gnu.org>
parents:
diff changeset
39 Saving a position records a place in a buffer so that you can move
Dave Love <fx@gnu.org>
parents:
diff changeset
40 back there later. Moving to a saved position switches to that buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
41 and moves point to that place in it.
Dave Love <fx@gnu.org>
parents:
diff changeset
42
Dave Love <fx@gnu.org>
parents:
diff changeset
43 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
44 @item C-x r @key{SPC} @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
45 Save position of point in register @var{r} (@code{point-to-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
46 @item C-x r j @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
47 Jump to the position saved in register @var{r} (@code{jump-to-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
48 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
49
Dave Love <fx@gnu.org>
parents:
diff changeset
50 @kindex C-x r SPC
Dave Love <fx@gnu.org>
parents:
diff changeset
51 @findex point-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
52 To save the current position of point in a register, choose a name
Dave Love <fx@gnu.org>
parents:
diff changeset
53 @var{r} and type @kbd{C-x r @key{SPC} @var{r}}. The register @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
54 retains the position thus saved until you store something else in that
Dave Love <fx@gnu.org>
parents:
diff changeset
55 register.
Dave Love <fx@gnu.org>
parents:
diff changeset
56
Dave Love <fx@gnu.org>
parents:
diff changeset
57 @kindex C-x r j
Dave Love <fx@gnu.org>
parents:
diff changeset
58 @findex jump-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
59 The command @kbd{C-x r j @var{r}} moves point to the position recorded
Dave Love <fx@gnu.org>
parents:
diff changeset
60 in register @var{r}. The register is not affected; it continues to
Dave Love <fx@gnu.org>
parents:
diff changeset
61 record the same position. You can jump to the saved position any number
Dave Love <fx@gnu.org>
parents:
diff changeset
62 of times.
Dave Love <fx@gnu.org>
parents:
diff changeset
63
Dave Love <fx@gnu.org>
parents:
diff changeset
64 If you use @kbd{C-x r j} to go to a saved position, but the buffer it
Dave Love <fx@gnu.org>
parents:
diff changeset
65 was saved from has been killed, @kbd{C-x r j} tries to create the buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
66 again by visiting the same file. Of course, this works only for buffers
Dave Love <fx@gnu.org>
parents:
diff changeset
67 that were visiting files.
Dave Love <fx@gnu.org>
parents:
diff changeset
68
Dave Love <fx@gnu.org>
parents:
diff changeset
69 @node RegText
Dave Love <fx@gnu.org>
parents:
diff changeset
70 @section Saving Text in Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
71
Dave Love <fx@gnu.org>
parents:
diff changeset
72 When you want to insert a copy of the same piece of text several
Dave Love <fx@gnu.org>
parents:
diff changeset
73 times, it may be inconvenient to yank it from the kill ring, since each
Dave Love <fx@gnu.org>
parents:
diff changeset
74 subsequent kill moves that entry further down the ring. An alternative
Dave Love <fx@gnu.org>
parents:
diff changeset
75 is to store the text in a register and later retrieve it.
Dave Love <fx@gnu.org>
parents:
diff changeset
76
Dave Love <fx@gnu.org>
parents:
diff changeset
77 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
78 @item C-x r s @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
79 Copy region into register @var{r} (@code{copy-to-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
80 @item C-x r i @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
81 Insert text from register @var{r} (@code{insert-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
82 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
83
Dave Love <fx@gnu.org>
parents:
diff changeset
84 @kindex C-x r s
Dave Love <fx@gnu.org>
parents:
diff changeset
85 @kindex C-x r i
Dave Love <fx@gnu.org>
parents:
diff changeset
86 @findex copy-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
87 @findex insert-register
Dave Love <fx@gnu.org>
parents:
diff changeset
88 @kbd{C-x r s @var{r}} stores a copy of the text of the region into the
Dave Love <fx@gnu.org>
parents:
diff changeset
89 register named @var{r}. Given a numeric argument, @kbd{C-x r s @var{r}}
Dave Love <fx@gnu.org>
parents:
diff changeset
90 deletes the text from the buffer as well.
Dave Love <fx@gnu.org>
parents:
diff changeset
91
Dave Love <fx@gnu.org>
parents:
diff changeset
92 @kbd{C-x r i @var{r}} inserts in the buffer the text from register
Dave Love <fx@gnu.org>
parents:
diff changeset
93 @var{r}. Normally it leaves point before the text and places the mark
Dave Love <fx@gnu.org>
parents:
diff changeset
94 after, but with a numeric argument (@kbd{C-u}) it puts point after the
Dave Love <fx@gnu.org>
parents:
diff changeset
95 text and the mark before.
Dave Love <fx@gnu.org>
parents:
diff changeset
96
Dave Love <fx@gnu.org>
parents:
diff changeset
97 @node RegRect
Dave Love <fx@gnu.org>
parents:
diff changeset
98 @section Saving Rectangles in Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
99
Dave Love <fx@gnu.org>
parents:
diff changeset
100 A register can contain a rectangle instead of linear text. The
Dave Love <fx@gnu.org>
parents:
diff changeset
101 rectangle is represented as a list of strings. @xref{Rectangles}, for
Dave Love <fx@gnu.org>
parents:
diff changeset
102 basic information on how to specify a rectangle in the buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
103
Dave Love <fx@gnu.org>
parents:
diff changeset
104 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
105 @findex copy-rectangle-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
106 @kindex C-x r r
Dave Love <fx@gnu.org>
parents:
diff changeset
107 @item C-x r r @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
108 Copy the region-rectangle into register @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
109 (@code{copy-rectangle-to-register}). With numeric argument, delete it as
Dave Love <fx@gnu.org>
parents:
diff changeset
110 well.
Dave Love <fx@gnu.org>
parents:
diff changeset
111 @item C-x r i @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
112 Insert the rectangle stored in register @var{r} (if it contains a
Dave Love <fx@gnu.org>
parents:
diff changeset
113 rectangle) (@code{insert-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
114 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
115
Dave Love <fx@gnu.org>
parents:
diff changeset
116 The @kbd{C-x r i @var{r}} command inserts a text string if the
Dave Love <fx@gnu.org>
parents:
diff changeset
117 register contains one, and inserts a rectangle if the register contains
Dave Love <fx@gnu.org>
parents:
diff changeset
118 one.
Dave Love <fx@gnu.org>
parents:
diff changeset
119
Dave Love <fx@gnu.org>
parents:
diff changeset
120 See also the command @code{sort-columns}, which you can think of
Dave Love <fx@gnu.org>
parents:
diff changeset
121 as sorting a rectangle. @xref{Sorting}.
Dave Love <fx@gnu.org>
parents:
diff changeset
122
Dave Love <fx@gnu.org>
parents:
diff changeset
123 @node RegConfig
Dave Love <fx@gnu.org>
parents:
diff changeset
124 @section Saving Window Configurations in Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
125
Dave Love <fx@gnu.org>
parents:
diff changeset
126 @findex window-configuration-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
127 @findex frame-configuration-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
128 @kindex C-x r w
Dave Love <fx@gnu.org>
parents:
diff changeset
129 @kindex C-x r f
Dave Love <fx@gnu.org>
parents:
diff changeset
130 You can save the window configuration of the selected frame in a
Dave Love <fx@gnu.org>
parents:
diff changeset
131 register, or even the configuration of all windows in all frames, and
Dave Love <fx@gnu.org>
parents:
diff changeset
132 restore the configuration later.
Dave Love <fx@gnu.org>
parents:
diff changeset
133
Dave Love <fx@gnu.org>
parents:
diff changeset
134 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
135 @item C-x r w @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
136 Save the state of the selected frame's windows in register @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
137 (@code{window-configuration-to-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
138 @item C-x r f @var{r}
Dave Love <fx@gnu.org>
parents:
diff changeset
139 Save the state of all frames, including all their windows, in register
Dave Love <fx@gnu.org>
parents:
diff changeset
140 @var{r} (@code{frame-configuration-to-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
141 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
142
Dave Love <fx@gnu.org>
parents:
diff changeset
143 Use @kbd{C-x r j @var{r}} to restore a window or frame configuration.
Dave Love <fx@gnu.org>
parents:
diff changeset
144 This is the same command used to restore a cursor position. When you
Dave Love <fx@gnu.org>
parents:
diff changeset
145 restore a frame configuration, any existing frames not included in the
Dave Love <fx@gnu.org>
parents:
diff changeset
146 configuration become invisible. If you wish to delete these frames
Dave Love <fx@gnu.org>
parents:
diff changeset
147 instead, use @kbd{C-u C-x r j @var{r}}.
Dave Love <fx@gnu.org>
parents:
diff changeset
148
Dave Love <fx@gnu.org>
parents:
diff changeset
149 @node RegNumbers
Dave Love <fx@gnu.org>
parents:
diff changeset
150 @section Keeping Numbers in Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
151
Dave Love <fx@gnu.org>
parents:
diff changeset
152 There are commands to store a number in a register, to insert
Dave Love <fx@gnu.org>
parents:
diff changeset
153 the number in the buffer in decimal, and to increment it. These commands
Dave Love <fx@gnu.org>
parents:
diff changeset
154 can be useful in keyboard macros (@pxref{Keyboard Macros}).
Dave Love <fx@gnu.org>
parents:
diff changeset
155
Dave Love <fx@gnu.org>
parents:
diff changeset
156 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
157 @item C-u @var{number} C-x r n @var{reg}
Dave Love <fx@gnu.org>
parents:
diff changeset
158 @kindex C-x r n
Dave Love <fx@gnu.org>
parents:
diff changeset
159 @findex number-to-register
Dave Love <fx@gnu.org>
parents:
diff changeset
160 Store @var{number} into register @var{reg} (@code{number-to-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
161 @item C-u @var{number} C-x r + @var{reg}
Dave Love <fx@gnu.org>
parents:
diff changeset
162 @kindex C-x r +
Dave Love <fx@gnu.org>
parents:
diff changeset
163 @findex increment-register
Dave Love <fx@gnu.org>
parents:
diff changeset
164 Increment the number in register @var{reg} by @var{number}
Dave Love <fx@gnu.org>
parents:
diff changeset
165 (@code{increment-register}).
Dave Love <fx@gnu.org>
parents:
diff changeset
166 @item C-x r g @var{reg}
Dave Love <fx@gnu.org>
parents:
diff changeset
167 Insert the number from register @var{reg} into the buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
168 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
169
Dave Love <fx@gnu.org>
parents:
diff changeset
170 @kbd{C-x r g} is the same command used to insert any other
Dave Love <fx@gnu.org>
parents:
diff changeset
171 sort of register contents into the buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
172
Dave Love <fx@gnu.org>
parents:
diff changeset
173 @node RegFiles
Dave Love <fx@gnu.org>
parents:
diff changeset
174 @section Keeping File Names in Registers
Dave Love <fx@gnu.org>
parents:
diff changeset
175
Dave Love <fx@gnu.org>
parents:
diff changeset
176 If you visit certain file names frequently, you can visit them more
Dave Love <fx@gnu.org>
parents:
diff changeset
177 conveniently if you put their names in registers. Here's the Lisp code
Dave Love <fx@gnu.org>
parents:
diff changeset
178 used to put a file name in a register:
Dave Love <fx@gnu.org>
parents:
diff changeset
179
Dave Love <fx@gnu.org>
parents:
diff changeset
180 @smallexample
Dave Love <fx@gnu.org>
parents:
diff changeset
181 (set-register ?@var{r} '(file . @var{name}))
Dave Love <fx@gnu.org>
parents:
diff changeset
182 @end smallexample
Dave Love <fx@gnu.org>
parents:
diff changeset
183
Dave Love <fx@gnu.org>
parents:
diff changeset
184 @need 3000
Dave Love <fx@gnu.org>
parents:
diff changeset
185 @noindent
Dave Love <fx@gnu.org>
parents:
diff changeset
186 For example,
Dave Love <fx@gnu.org>
parents:
diff changeset
187
Dave Love <fx@gnu.org>
parents:
diff changeset
188 @smallexample
Dave Love <fx@gnu.org>
parents:
diff changeset
189 (set-register ?z '(file . "/gd/gnu/emacs/19.0/src/ChangeLog"))
Dave Love <fx@gnu.org>
parents:
diff changeset
190 @end smallexample
Dave Love <fx@gnu.org>
parents:
diff changeset
191
Dave Love <fx@gnu.org>
parents:
diff changeset
192 @noindent
Dave Love <fx@gnu.org>
parents:
diff changeset
193 puts the file name shown in register @samp{z}.
Dave Love <fx@gnu.org>
parents:
diff changeset
194
Dave Love <fx@gnu.org>
parents:
diff changeset
195 To visit the file whose name is in register @var{r}, type @kbd{C-x r j
Dave Love <fx@gnu.org>
parents:
diff changeset
196 @var{r}}. (This is the same command used to jump to a position or
Dave Love <fx@gnu.org>
parents:
diff changeset
197 restore a frame configuration.)
Dave Love <fx@gnu.org>
parents:
diff changeset
198
Dave Love <fx@gnu.org>
parents:
diff changeset
199 @node Bookmarks
Dave Love <fx@gnu.org>
parents:
diff changeset
200 @section Bookmarks
Dave Love <fx@gnu.org>
parents:
diff changeset
201 @cindex bookmarks
Dave Love <fx@gnu.org>
parents:
diff changeset
202
Dave Love <fx@gnu.org>
parents:
diff changeset
203 @dfn{Bookmarks} are somewhat like registers in that they record
Dave Love <fx@gnu.org>
parents:
diff changeset
204 positions you can jump to. Unlike registers, they have long names, and
Dave Love <fx@gnu.org>
parents:
diff changeset
205 they persist automatically from one Emacs session to the next. The
Dave Love <fx@gnu.org>
parents:
diff changeset
206 prototypical use of bookmarks is to record ``where you were reading'' in
Dave Love <fx@gnu.org>
parents:
diff changeset
207 various files.
Dave Love <fx@gnu.org>
parents:
diff changeset
208
Dave Love <fx@gnu.org>
parents:
diff changeset
209 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
210 @item C-x r m @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
211 Set the bookmark for the visited file, at point.
Dave Love <fx@gnu.org>
parents:
diff changeset
212
Dave Love <fx@gnu.org>
parents:
diff changeset
213 @item C-x r m @var{bookmark} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
214 @findex bookmark-set
Dave Love <fx@gnu.org>
parents:
diff changeset
215 Set the bookmark named @var{bookmark} at point (@code{bookmark-set}).
Dave Love <fx@gnu.org>
parents:
diff changeset
216
Dave Love <fx@gnu.org>
parents:
diff changeset
217 @item C-x r b @var{bookmark} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
218 @findex bookmark-jump
Dave Love <fx@gnu.org>
parents:
diff changeset
219 Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}).
Dave Love <fx@gnu.org>
parents:
diff changeset
220
Dave Love <fx@gnu.org>
parents:
diff changeset
221 @item C-x r l
Dave Love <fx@gnu.org>
parents:
diff changeset
222 @findex list-bookmarks
Dave Love <fx@gnu.org>
parents:
diff changeset
223 List all bookmarks (@code{list-bookmarks}).
Dave Love <fx@gnu.org>
parents:
diff changeset
224
Dave Love <fx@gnu.org>
parents:
diff changeset
225 @item M-x bookmark-save
Dave Love <fx@gnu.org>
parents:
diff changeset
226 @findex bookmark-save
Dave Love <fx@gnu.org>
parents:
diff changeset
227 Save all the current bookmark values in the default bookmark file.
Dave Love <fx@gnu.org>
parents:
diff changeset
228 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
229
Dave Love <fx@gnu.org>
parents:
diff changeset
230 @kindex C-x r m
Dave Love <fx@gnu.org>
parents:
diff changeset
231 @findex bookmark-set
Dave Love <fx@gnu.org>
parents:
diff changeset
232 @kindex C-x r b
Dave Love <fx@gnu.org>
parents:
diff changeset
233 @findex bookmark-jump
Dave Love <fx@gnu.org>
parents:
diff changeset
234 The prototypical use for bookmarks is to record one current position
Dave Love <fx@gnu.org>
parents:
diff changeset
235 in each of several files. So the command @kbd{C-x r m}, which sets a
Dave Love <fx@gnu.org>
parents:
diff changeset
236 bookmark, uses the visited file name as the default for the bookmark
Dave Love <fx@gnu.org>
parents:
diff changeset
237 name. If you name each bookmark after the file it points to, then you
Dave Love <fx@gnu.org>
parents:
diff changeset
238 can conveniently revisit any of those files with @kbd{C-x r b}, and move
Dave Love <fx@gnu.org>
parents:
diff changeset
239 to the position of the bookmark at the same time.
Dave Love <fx@gnu.org>
parents:
diff changeset
240
Dave Love <fx@gnu.org>
parents:
diff changeset
241 @kindex C-x r l
Dave Love <fx@gnu.org>
parents:
diff changeset
242 To display a list of all your bookmarks in a separate buffer, type
Dave Love <fx@gnu.org>
parents:
diff changeset
243 @kbd{C-x r l} (@code{list-bookmarks}). If you switch to that buffer,
Dave Love <fx@gnu.org>
parents:
diff changeset
244 you can use it to edit your bookmark definitions or annotate the
Dave Love <fx@gnu.org>
parents:
diff changeset
245 bookmarks. Type @kbd{C-h m} in that buffer for more information about
Dave Love <fx@gnu.org>
parents:
diff changeset
246 its special editing commands.
Dave Love <fx@gnu.org>
parents:
diff changeset
247
Dave Love <fx@gnu.org>
parents:
diff changeset
248 When you kill Emacs, Emacs offers to save your bookmark values in your
Dave Love <fx@gnu.org>
parents:
diff changeset
249 default bookmark file, @file{~/.emacs.bmk}, if you have changed any
Dave Love <fx@gnu.org>
parents:
diff changeset
250 bookmark values. You can also save the bookmarks at any time with the
Dave Love <fx@gnu.org>
parents:
diff changeset
251 @kbd{M-x bookmark-save} command. The bookmark commands load your
Dave Love <fx@gnu.org>
parents:
diff changeset
252 default bookmark file automatically. This saving and loading is how
Dave Love <fx@gnu.org>
parents:
diff changeset
253 bookmarks persist from one Emacs session to the next.
Dave Love <fx@gnu.org>
parents:
diff changeset
254
Dave Love <fx@gnu.org>
parents:
diff changeset
255 @vindex bookmark-save-flag
Dave Love <fx@gnu.org>
parents:
diff changeset
256 If you set the variable @code{bookmark-save-flag} to 1, then each
Dave Love <fx@gnu.org>
parents:
diff changeset
257 command that sets a bookmark will also save your bookmarks; this way,
Dave Love <fx@gnu.org>
parents:
diff changeset
258 you don't lose any bookmark values even if Emacs crashes. (The value,
Dave Love <fx@gnu.org>
parents:
diff changeset
259 if a number, says how many bookmark modifications should go by between
Dave Love <fx@gnu.org>
parents:
diff changeset
260 saving.)
Dave Love <fx@gnu.org>
parents:
diff changeset
261
Dave Love <fx@gnu.org>
parents:
diff changeset
262 @vindex bookmark-search-size
Dave Love <fx@gnu.org>
parents:
diff changeset
263 Bookmark position values are saved with surrounding context, so that
Dave Love <fx@gnu.org>
parents:
diff changeset
264 @code{bookmark-jump} can find the proper position even if the file is
Dave Love <fx@gnu.org>
parents:
diff changeset
265 modified slightly. The variable @code{bookmark-search-size} says how
Dave Love <fx@gnu.org>
parents:
diff changeset
266 many characters of context to record, on each side of the bookmark's
Dave Love <fx@gnu.org>
parents:
diff changeset
267 position.
Dave Love <fx@gnu.org>
parents:
diff changeset
268
Dave Love <fx@gnu.org>
parents:
diff changeset
269 Here are some additional commands for working with bookmarks:
Dave Love <fx@gnu.org>
parents:
diff changeset
270
Dave Love <fx@gnu.org>
parents:
diff changeset
271 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
272 @item M-x bookmark-load @key{RET} @var{filename} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
273 @findex bookmark-load
Dave Love <fx@gnu.org>
parents:
diff changeset
274 Load a file named @var{filename} that contains a list of bookmark
Dave Love <fx@gnu.org>
parents:
diff changeset
275 values. You can use this command, as well as @code{bookmark-write}, to
Dave Love <fx@gnu.org>
parents:
diff changeset
276 work with other files of bookmark values in addition to your default
Dave Love <fx@gnu.org>
parents:
diff changeset
277 bookmark file.
Dave Love <fx@gnu.org>
parents:
diff changeset
278
Dave Love <fx@gnu.org>
parents:
diff changeset
279 @item M-x bookmark-write @key{RET} @var{filename} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
280 @findex bookmark-write
Dave Love <fx@gnu.org>
parents:
diff changeset
281 Save all the current bookmark values in the file @var{filename}.
Dave Love <fx@gnu.org>
parents:
diff changeset
282
Dave Love <fx@gnu.org>
parents:
diff changeset
283 @item M-x bookmark-delete @key{RET} @var{bookmark} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
284 @findex bookmark-delete
Dave Love <fx@gnu.org>
parents:
diff changeset
285 Delete the bookmark named @var{bookmark}.
Dave Love <fx@gnu.org>
parents:
diff changeset
286
Dave Love <fx@gnu.org>
parents:
diff changeset
287 @item M-x bookmark-insert-location @key{RET} @var{bookmark} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
288 @findex bookmark-insert-location
Dave Love <fx@gnu.org>
parents:
diff changeset
289 Insert in the buffer the name of the file that bookmark @var{bookmark}
Dave Love <fx@gnu.org>
parents:
diff changeset
290 points to.
Dave Love <fx@gnu.org>
parents:
diff changeset
291
Dave Love <fx@gnu.org>
parents:
diff changeset
292 @item M-x bookmark-insert @key{RET} @var{bookmark} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
293 @findex bookmark-insert
Dave Love <fx@gnu.org>
parents:
diff changeset
294 Insert in the buffer the @emph{contents} of the file that bookmark
Dave Love <fx@gnu.org>
parents:
diff changeset
295 @var{bookmark} points to.
Dave Love <fx@gnu.org>
parents:
diff changeset
296 @end table