]> code.delx.au - gnu-emacs/blobdiff - man/mark.texi
(User Interface, Basic Types): Document need to put some
[gnu-emacs] / man / mark.texi
index c472dffb5a6254f0ecdf28216db0a951d869cbcd..be446ab6bfc091d579c8bf351ac714311161c2ff 100644 (file)
@@ -1,6 +1,6 @@
 @c This is part of the Emacs manual.
 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002,
-@c   2003, 2004, 2005 Free Software Foundation, Inc.
+@c   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Mark, Killing, Help, Top
 @chapter The Mark and the Region
@@ -44,7 +44,6 @@ mark in the @dfn{mark ring}.
                          when there is one.
 * Momentary Mark::      Enabling Transient Mark mode momentarily.
 * Using Region::       Summary of ways to operate on contents of the region.
-* Selective Undo::      Undoing within a given region.
 * Marking Objects::    Commands to put region around textual units.
 * Mark Ring::          Previous mark positions saved so you can go back there.
 * Global Mark Ring::    Previous mark positions in various buffers.
@@ -88,9 +87,11 @@ button one across a range of text; that puts point where you release the
 mouse button, and sets the mark at the other end of that range.  Or you
 can click mouse button three, which sets the mark at point (like
 @kbd{C-@key{SPC}}) and then moves point where you clicked (like
-@kbd{Mouse-1}).  Both of these methods copy the region into the kill
+@kbd{Mouse-1}).
+
+  Using the mouse to mark a region copies the region into the kill
 ring in addition to setting the mark; that gives behavior consistent
-with other window-driven applications, but if you don't want to modify
+with other window-driven applications.  If you don't want to modify
 the kill ring, you must use keyboard commands to set the mark.
 @xref{Mouse Commands}.
 
@@ -138,21 +139,23 @@ have a text terminal where typing @kbd{C-@key{SPC}} does not produce
   On a terminal that supports colors, Emacs has the ability to
 highlight the current region.  But normally it does not.  Why not?
 
-  Once you have set the mark in a buffer, there is @emph{always} a
-region in that buffer.  This is because every command that sets the
-mark also activates it, and nothing ever deactivates it.  Highlighting
-the region all the time would be a nuisance.  So normally Emacs
-highlights the region only immediately after you have selected one
-with the mouse.
+  In the normal mode of use, every command that sets the mark also
+activates it, and nothing ever deactivates it.  Thus, once you have
+set the mark in a buffer, there is @emph{always} a region in that
+buffer.  Highlighting the region all the time would be a nuisance.  So
+normally Emacs highlights the region only immediately after you have
+selected one with the mouse.
 
   If you want region highlighting, you can use Transient Mark mode.
-This is a more rigid mode of operation in which the region always
-``lasts'' only until you use it; you explicitly must set up a region
-for each command that uses one.  In Transient Mark mode, most of the
-time there is no region; therefore, highlighting the region when it
-exists is useful and not annoying.  When Transient Mark mode is
-enabled, Emacs always highlights the region whenever there is a
-region.
+This is a more rigid mode of operation in which the region ``lasts''
+only until you use it; operating on the region text deactivates the
+mark, so there is no region any more.  Therefore, you must explicitly
+set up a region for each command that uses one.
+
+  When Transient Mark mode is enabled, Emacs highlights the region,
+whenever there is a region.  In Transient Mark mode, most of the time
+there is no region; therefore, highlighting the region when it exists
+is useful and not annoying.
 
 @findex transient-mark-mode
   To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}.
@@ -189,7 +192,7 @@ region active again by typing @kbd{C-x C-x}.
 
 @item
 If Delete Selection mode is also enabled, some commands delete the
-region when used while the mark is active.  @xref{Graphical Kill}.
+region when used while the mark is active.  @xref{Mouse Commands}.
 
 @item
 Quitting with @kbd{C-g} deactivates the mark.
@@ -299,30 +302,12 @@ Print hardcopy with @kbd{M-x print-region} (@pxref{Printing}).
 @item
 Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}).
 @item
-Undo changes within it using @kbd{C-u C-x u} (@pxref{Selective Undo}).
+Undo changes within it using @kbd{C-u C-x u} (@pxref{Undo}).
 @end itemize
 
   Most commands that operate on the text in the region have the word
 @code{region} in their names.
 
-@node Selective Undo
-@section Selective Undo
-
-@cindex selective undo
-@kindex C-u C-x u
-  Ordinary undo applies to all changes made in the current buffer.  You
-can also perform @dfn{selective undo}, limited to the current region
-(@pxref{Mark}).
-
-  To do this, specify the region you want, then run the @code{undo}
-command with a prefix argument (the value does not matter): @kbd{C-u
-C-x u} or @kbd{C-u C-_}.  This undoes the most recent change in the
-region.  To undo further changes in the same region, repeat the
-@code{undo} command (no prefix argument is needed).  In Transient Mark
-mode (@pxref{Transient Mark}), any use of @code{undo} when there is an
-active region performs selective undo; you do not need a prefix
-argument.
-
 @node Marking Objects
 @section Commands to Mark Textual Objects
 
@@ -349,11 +334,11 @@ Put region around current page (@code{mark-page}).
 @kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next
 word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the
 next balanced expression (@pxref{Expressions}).  These commands handle
-arguments just like @kbd{M-f} and @kbd{C-M-f}.  If you repeat these
-commands, that extends the region.  For example, you can type either
-@kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words.  This
-command also extends the region when the mark is active in Transient
-Mark mode, regardless of the last command.
+arguments just like @kbd{M-f} and @kbd{C-M-f}.  Repeating these
+commands extends the region.  For example, you can type either
+@kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words.  These
+commands also extend the region in Transient Mark mode, regardless of
+the last command.
 
 @kindex C-x h
 @findex mark-whole-buffer
@@ -362,18 +347,18 @@ buffer.  For example, @kbd{M-h} (@code{mark-paragraph}) moves point to
 the beginning of the paragraph that surrounds or follows point, and
 puts the mark at the end of that paragraph (@pxref{Paragraphs}).  It
 prepares the region so you can indent, case-convert, or kill a whole
-paragraph.  With prefix argument, if the argument's value is positive,
+paragraph.  With prefix argument, if the argument's value is positive,
 @kbd{M-h} marks that many paragraphs starting with the one surrounding
 point.  If the prefix argument is @minus{}@var{n}, @kbd{M-h} also
 marks @var{n} paragraphs, running back form the one surrounding point.
 In that last case, point moves forward to the end of that paragraph,
 and the mark goes at the start of the region.  Repeating the @kbd{M-h}
-command extends the region, just as with @kbd{M-@@} and @kbd{C-M-@@}.
+command extends the region to subsequent paragraphs.
 
   @kbd{C-M-h} (@code{mark-defun}) similarly puts point before, and the
 mark after, the current (or following) major top-level definition, or
-defun (@pxref{Moving by Defuns}).  Repeating @kbd{C-M-h} also extends
-the region.
+defun (@pxref{Moving by Defuns}).  Repeating @kbd{C-M-h} extends
+the region to subsequent defuns.
 
   @kbd{C-x C-p} (@code{mark-page}) puts point before the current page,
 and mark at the end (@pxref{Pages}).  The mark goes after the
@@ -384,7 +369,7 @@ negative) instead of the current page.
 
   Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire
 buffer as the region, by putting point at the beginning and the mark at
-the end.
+the end.  (In some programs this is called ``select all.'')
 
   In Transient Mark mode, all of these commands activate the mark.