comparison man/mark.texi @ 38461:23f63206a867

Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 17 Jul 2001 10:50:35 +0000
parents 2fc02d49a9a4
children c8c4805bde95
comparison
equal deleted inserted replaced
38460:6bee7ffac2cd 38461:23f63206a867
93 93
94 @kindex C-x C-x 94 @kindex C-x C-x
95 @findex exchange-point-and-mark 95 @findex exchange-point-and-mark
96 Ordinary terminals have only one cursor, so there is no way for Emacs 96 Ordinary terminals have only one cursor, so there is no way for Emacs
97 to show you where the mark is located. You have to remember. The usual 97 to show you where the mark is located. You have to remember. The usual
98 solution to this problem is to set the mark and then use it soon, before 98 solution to this problem is to set the mark and then use it before
99 you forget where it is. Alternatively, you can see where the mark is 99 you forget where it is. Alternatively, you can see where the mark is
100 with the command @kbd{C-x C-x} (@code{exchange-point-and-mark}) which 100 with the command @kbd{C-x C-x} (@code{exchange-point-and-mark}) which
101 puts the mark where point was and point where the mark was. The extent 101 puts the mark where point was and point where the mark was. The extent
102 of the region is unchanged, but the cursor and point are now at the 102 of the region is unchanged, but the cursor and point are now at the
103 previous position of the mark. In Transient Mark mode, this command 103 previous position of the mark. In Transient Mark mode, this command
104 reactivates the mark. 104 reactivates the mark.
105 105
106 @kbd{C-x C-x} is also useful when you are satisfied with the position 106 @kbd{C-x C-x} is also useful when you are satisfied with the position
107 of point but want to move the other end of the region (where the mark 107 of point but want to move the other end of the region (where the mark
108 is); do @kbd{C-x C-x} to put point at that end of the region, and then 108 is); do @kbd{C-x C-x} to put point at that end of the region, and then
109 move it. A second use of @kbd{C-x C-x}, if necessary, puts the mark at 109 move it. Using @kbd{C-x C-x} a second time, if necessary, puts the mark at
110 the new position with point back at its original position. 110 the new position with point back at its original position.
111 111
112 For more facilities that allow you to go to previously set marks, see 112 For more facilities that allow you to go to previously set marks, see
113 @ref{Mark Ring}. 113 @ref{Mark Ring}.
114 114
153 Here are the details of Transient Mark mode: 153 Here are the details of Transient Mark mode:
154 154
155 @itemize @bullet 155 @itemize @bullet
156 @item 156 @item
157 To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}). 157 To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}).
158 This makes the mark active; as you move point, you will see the region 158 This makes the mark active; as you move point, you will see the
159 highlighting grow and shrink. 159 highlighted region grow and shrink.
160 160
161 @item 161 @item
162 The mouse commands for specifying the mark also make it active. So do 162 The mouse commands for specifying the mark also make it active. So do
163 keyboard commands whose purpose is to specify a region, including 163 keyboard commands whose purpose is to specify a region, including
164 @kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and 164 @kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and
173 deactivates the mark. This means any subsequent command that operates 173 deactivates the mark. This means any subsequent command that operates
174 on a region will get an error and refuse to operate. You can make the 174 on a region will get an error and refuse to operate. You can make the
175 region active again by typing @kbd{C-x C-x}. 175 region active again by typing @kbd{C-x C-x}.
176 176
177 @item 177 @item
178 Commands like @kbd{M->} and @kbd{C-s} that ``leave the mark behind'' in 178 Commands like @kbd{M->} and @kbd{C-s} that ``leave the mark behind'', in
179 addition to some other primary purpose do not activate the new mark. 179 addition to some other primary purpose, do not activate the new mark.
180 You can activate the new region by executing @kbd{C-x C-x} 180 You can activate the new region by executing @kbd{C-x C-x}
181 (@code{exchange-point-and-mark}). 181 (@code{exchange-point-and-mark}).
182 182
183 @item 183 @item
184 @kbd{C-s} when the mark is active does not alter the mark. 184 @kbd{C-s} when the mark is active does not alter the mark.
193 @kbd{C-u C-x u} if you want it to operate on the region. 193 @kbd{C-u C-x u} if you want it to operate on the region.
194 @xref{Undo}. Other commands that act this way are identified 194 @xref{Undo}. Other commands that act this way are identified
195 in their own documentation. 195 in their own documentation.
196 @end itemize 196 @end itemize
197 197
198 Highlighting of the region uses the @code{region} face; you can 198 The highlighting of the region uses the @code{region} face; you can
199 customize how the region is highlighted by changing this face. 199 customize the appearance of the highlighted region by changing this
200 @xref{Face Customization}. 200 face. @xref{Face Customization}.
201 201
202 @vindex highlight-nonselected-windows 202 @vindex highlight-nonselected-windows
203 When multiple windows show the same buffer, they can have different 203 When multiple windows show the same buffer, they can have different
204 regions, because they can have different values of point (though they 204 regions, because they can have different values of point (though they
205 all share one common mark position). Ordinarily, only the selected 205 all share one common mark position). Ordinarily, only the selected
206 window highlights its region (@pxref{Windows}). However, if the 206 window highlights its region (@pxref{Windows}). However, if the
207 variable @code{highlight-nonselected-windows} is non-@code{nil}, then 207 variable @code{highlight-nonselected-windows} is non-@code{nil}, then
208 each window highlights its own region (provided that Transient Mark mode 208 each window highlights its own region (provided that Transient Mark mode
209 is enabled and the window's buffer's mark is active). 209 is enabled and the mark in the buffer's window is active).
210 210
211 When Transient Mark mode is not enabled, every command that sets the 211 When Transient Mark mode is not enabled, every command that sets the
212 mark also activates it, and nothing ever deactivates it. 212 mark also activates it, and nothing ever deactivates it.
213 213
214 @vindex mark-even-if-inactive 214 @vindex mark-even-if-inactive
247 Print hardcopy with @kbd{M-x print-region} (@pxref{Hardcopy}). 247 Print hardcopy with @kbd{M-x print-region} (@pxref{Hardcopy}).
248 @item 248 @item
249 Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}). 249 Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}).
250 @end itemize 250 @end itemize
251 251
252 Most commands that operate on the text in the 252 Most commands that operate on text in the region have the word
253 region have the word @code{region} in their names. 253 @code{region} in their names.
254 254
255 @node Marking Objects 255 @node Marking Objects
256 @section Commands to Mark Textual Objects 256 @section Commands to Mark Textual Objects
257 257
258 @cindex marking sections of text 258 @cindex marking sections of text
259 Here are the commands for placing point and the mark around a textual 259 Here are the commands for placing point and the mark around a textual
260 object such as a word, list, paragraph or page. 260 object such as a word, list, paragraph or page.
261 261
262 @table @kbd 262 @table @kbd
263 @item M-@@ 263 @item M-@@
264 Set mark after end of next word (@code{mark-word}). This command and 264 Set mark after the end of next word (@code{mark-word}). This command and
265 the following one do not move point. 265 the following one do not move point.
266 @item C-M-@@ 266 @item C-M-@@
267 Set mark after end of following balanced expression (@code{mark-sexp}). 267 Set mark after the end of following balanced expression (@code{mark-sexp}).
268 @item M-h 268 @item M-h
269 Put region around current paragraph (@code{mark-paragraph}). 269 Put region around the current paragraph (@code{mark-paragraph}).
270 @item C-M-h 270 @item C-M-h
271 Put region around current defun (@code{mark-defun}). 271 Put region around the current defun (@code{mark-defun}).
272 @item C-x h 272 @item C-x h
273 Put region around entire buffer (@code{mark-whole-buffer}). 273 Put region around the entire buffer (@code{mark-whole-buffer}).
274 @item C-x C-p 274 @item C-x C-p
275 Put region around current page (@code{mark-page}). 275 Put region around the current page (@code{mark-page}).
276 @end table 276 @end table
277 277
278 @kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next 278 @kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next
279 word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the 279 word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the
280 next balanced expression (@pxref{Expressions}). These commands handle 280 next balanced expression (@pxref{Expressions}). These commands handle
286 buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to 286 buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to
287 the beginning of the paragraph that surrounds or follows point, and puts 287 the beginning of the paragraph that surrounds or follows point, and puts
288 the mark at the end of that paragraph (@pxref{Paragraphs}). It prepares 288 the mark at the end of that paragraph (@pxref{Paragraphs}). It prepares
289 the region so you can indent, case-convert, or kill a whole paragraph. 289 the region so you can indent, case-convert, or kill a whole paragraph.
290 290
291 @kbd{C-M-h} (@code{mark-defun}) similarly puts point before and the 291 @kbd{C-M-h} (@code{mark-defun}) similarly puts point before, and the
292 mark after the current or following major top-level definition, or 292 mark after, the current or following major top-level definition, or
293 defun (@pxref{Moving by Defuns}). @kbd{C-x C-p} (@code{mark-page}) 293 defun (@pxref{Moving by Defuns}). @kbd{C-x C-p} (@code{mark-page})
294 puts point before the current page, and mark at the end 294 puts point before the current page, and mark at the end
295 (@pxref{Pages}). The mark goes after the terminating page delimiter 295 (@pxref{Pages}). The mark goes after the terminating page delimiter
296 (to include it), while point goes after the preceding page delimiter 296 (to include it), while point goes after the preceding page delimiter
297 (to exclude it). A numeric argument specifies a later page (if 297 (to exclude it). A numeric argument specifies a later page (if
313 Aside from delimiting the region, the mark is also useful for 313 Aside from delimiting the region, the mark is also useful for
314 remembering a spot that you may want to go back to. To make this 314 remembering a spot that you may want to go back to. To make this
315 feature more useful, each buffer remembers 16 previous locations of the 315 feature more useful, each buffer remembers 16 previous locations of the
316 mark, in the @dfn{mark ring}. Commands that set the mark also push the 316 mark, in the @dfn{mark ring}. Commands that set the mark also push the
317 old mark onto this ring. To return to a marked location, use @kbd{C-u 317 old mark onto this ring. To return to a marked location, use @kbd{C-u
318 C-@key{SPC}} (or @kbd{C-u C-@@}); this is the command 318 C-@key{SPC}} (or @kbd{C-u C-@@}); this is the same as the command
319 @code{set-mark-command} given a numeric argument. It moves point to 319 @code{set-mark-command} given a numeric argument. It moves point to
320 where the mark was, and restores the mark from the ring of former 320 where the mark was, and restores the mark from the ring of former
321 marks. Thus, repeated use of this command moves point to all of the old 321 marks. Thus, repeated use of this command moves point to all of the old
322 marks on the ring, one by one. The mark positions you move through in 322 marks on the ring, one by one. The mark positions you move through in
323 this way are not lost; they go to the end of the ring. 323 this way are not lost; they go to the end of the ring.
339 Registers}). 339 Registers}).
340 340
341 @vindex mark-ring-max 341 @vindex mark-ring-max
342 The variable @code{mark-ring-max} specifies the maximum number of 342 The variable @code{mark-ring-max} specifies the maximum number of
343 entries to keep in the mark ring. If that many entries exist and 343 entries to keep in the mark ring. If that many entries exist and
344 another one is pushed, the last one in the list is discarded. Repeating 344 another one is pushed, the earliest one in the list is discarded. Repeating
345 @kbd{C-u C-@key{SPC}} cycles through the positions currently in the 345 @kbd{C-u C-@key{SPC}} cycles through the positions currently in the
346 ring. 346 ring.
347 347
348 @vindex mark-ring 348 @vindex mark-ring
349 The variable @code{mark-ring} holds the mark ring itself, as a list of 349 The variable @code{mark-ring} holds the mark ring itself, as a list of