(emacs)Setting Mark


Next: Transient Mark Up: Mark

Setting the Mark
================

   Here are some commands for setting the mark:

`C-SPC'
     Set the mark where point is (`set-mark-command').

`C-@'
     The same.

`C-x C-x'
     Interchange mark and point (`exchange-point-and-mark').

   For example, suppose you wish to convert part of the buffer to all
upper-case, using the `C-x C-u' (`upcase-region') command which
operates on the text in the region.  You can first go to the beginning
of the text to be capitalized, type `C-SPC' to put the mark there, move
to the end, and then type `C-x C-u'.  Or, you can set the mark at the
end of the text, move to the beginning, and then type `C-x C-u'.

   The most common way to set the mark is with the `C-SPC' command
(`set-mark-command').  This sets the mark where point is.  Then you can
move point away, leaving the mark behind.

   Ordinary terminals have only one cursor, so there is no way for Emacs
to show you where the mark is located.  You have to remember.  The usual
solution to this problem is to set the mark and then use it soon, before
you forget where it is.  Alternatively, you can see where the mark is
with the command `C-x C-x' (`exchange-point-and-mark') which puts the
mark where point was and point where the mark was.  The extent of the
region is unchanged, but the cursor and point are now at the previous
position of the mark.

   `C-x C-x' is also useful when you are satisfied with the position of
point but want to move the mark; do `C-x C-x' to put point at that end
of the region, and then move it.  A second use of `C-x C-x', if
necessary, puts the mark at the new position with point back at its
original position.

   There is no such character as `C-SPC' in ASCII; when you type SPC
while holding down CTRL, what you get on most ordinary terminals is the
character `C-@'.  This key is actually bound to `set-mark-command'.
But unless you are unlucky enough to have a terminal where typing
`C-SPC' does not produce `C-@', you might as well think of this
character as `C-SPC'.  Under X, `C-SPC' is actually a distinct
character, but its binding is still `set-mark-command'.


automatically generated by info2www