]> code.delx.au - gnu-emacs/blobdiff - man/killing.texi
Fix command names dired-do-flagged-delete,
[gnu-emacs] / man / killing.texi
index c003b7aa678750f33cd2ae2e084d32e23b47b304..5ade2f214fafb25bf3aa34a5260176d6de1fa79d 100644 (file)
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985,86,87,93,94,95,97,2000 Free Software Foundation, Inc.
+@c Copyright (C) 1985,86,87,93,94,95,97,00,2001 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
 @chapter Killing and Moving Text
 @c See file emacs.texi for copying conditions.
 @iftex
 @chapter Killing and Moving Text
@@ -37,10 +37,14 @@ can use the @kbd{C-x u} (@code{undo}) command to undo it
 
 @vindex kill-read-only-ok
 @cindex read-only text, killing
 
 @vindex kill-read-only-ok
 @cindex read-only text, killing
-  By default, Emacs does not allow to kill text in read-only buffers.
-Setting the variable @code{kill-read-only-ok} to a non-@code{nil} value
-overrides that.  To alert you to the fact that you killed read-only
-text, Emacs prints a message to that effect in the echo area.
+  You cannot kill read-only text, since such text does not allow any
+kind of modification.  But some users like to use the kill commands to
+copy read-only text into the kill ring, without actually changing it.
+If you set the variable @code{kill-read-only-ok} to a non-@code{nil}
+value, the kill commands work specially in a read-only buffer: they
+move over text, and copy it to the kill ring, without actually
+deleting it from the buffer.  When this happens, a message in the echo
+area tells you what is happening.
 
   The delete commands include @kbd{C-d} (@code{delete-char}) and
 @key{DEL} (@code{delete-backward-char}), which delete only one character at
 
   The delete commands include @kbd{C-d} (@code{delete-char}) and
 @key{DEL} (@code{delete-backward-char}), which delete only one character at
@@ -49,6 +53,17 @@ that can destroy significant amounts of nontrivial data generally kill.
 The commands' names and individual descriptions use the words @samp{kill}
 and @samp{delete} to say which they do.
 
 The commands' names and individual descriptions use the words @samp{kill}
 and @samp{delete} to say which they do.
 
+@cindex Delete Selection mode
+@cindex mode, Delete Selection
+@findex delete-selection-mode
+  Many window systems follow the convention that insertion while text
+is selected deletes the selected text.  You can make Emacs behave this
+way by enabling Delete Selection mode, with @kbd{M-x
+delete-selection-mode}, or using Custom.  Another effect of this mode
+is that @key{DEL}, @kbd{C-d} and some other keys, when a selection
+exists, will kill the whole selection.  It also enables Transient Mark
+mode (@pxref{Transient Mark}).
+
 @menu
 * Deletion::            Commands for deleting small amounts of text and
                           blank areas.
 @menu
 * Deletion::            Commands for deleting small amounts of text and
                           blank areas.
@@ -62,14 +77,18 @@ and @samp{delete} to say which they do.
 @c ??? Should be backward-delete-char
 @findex delete-backward-char
 @findex delete-char
 @c ??? Should be backward-delete-char
 @findex delete-backward-char
 @findex delete-char
-@kindex DEL
-@kindex C-d
 
 @table @kbd
 @item C-d
 
 @table @kbd
 @item C-d
-Delete next character (@code{delete-char}).
+@itemx @key{Delete}
+Delete next character (@code{delete-char}).  If your keyboard has a
+@key{Delete} function key (usually located in the edit keypad), Emacs
+binds it to @code{delete-char} as well.
 @item @key{DEL}
 @item @key{DEL}
-Delete previous character (@code{delete-backward-char}).
+@itemx @key{BS}
+Delete previous character (@code{delete-backward-char}).  Some keyboards
+refer to this key as a ``backspace key'' and label it with a left arrow:
+@key{<-}.
 @item M-\
 Delete spaces and tabs around point (@code{delete-horizontal-space}).
 @item M-@key{SPC}
 @item M-\
 Delete spaces and tabs around point (@code{delete-horizontal-space}).
 @item M-@key{SPC}
@@ -82,6 +101,8 @@ Join two lines by deleting the intervening newline, along with any
 indentation following it (@code{delete-indentation}).
 @end table
 
 indentation following it (@code{delete-indentation}).
 @end table
 
+@kindex DEL
+@kindex C-d
   The most basic delete commands are @kbd{C-d} (@code{delete-char}) and
 @key{DEL} (@code{delete-backward-char}).  @kbd{C-d} deletes the
 character after point, the one the cursor is ``on top of.''  This
   The most basic delete commands are @kbd{C-d} (@code{delete-char}) and
 @key{DEL} (@code{delete-backward-char}).  @kbd{C-d} deletes the
 character after point, the one the cursor is ``on top of.''  This
@@ -91,6 +112,38 @@ in the buffer; deleting a newline joins two lines.  Actually, @kbd{C-d}
 and @key{DEL} aren't always delete commands; when given arguments, they
 kill instead, since they can erase more than one character this way.
 
 and @key{DEL} aren't always delete commands; when given arguments, they
 kill instead, since they can erase more than one character this way.
 
+@kindex BACKSPACE
+@kindex BS
+@kindex DELETE
+  Every keyboard has a large key, labeled @key{DEL}, @key{BACKSPACE},
+@key{BS} or @key{DELETE}, which is a short distance above the
+@key{RET} or @key{ENTER} key and is normally used for erasing what you
+have typed.  Regardless of the actual name on the key, in Emacs it is
+equivalent to @key{DEL}---or it should be.
+
+  Many keyboards (including standard PC keyboards) have a
+@key{BACKSPACE} key a short ways above @key{RET} or @key{ENTER}, and a
+@key{DELETE} key elsewhere.  In that case, the @key{BACKSPACE} key is
+@key{DEL}, and the @key{DELETE} key is equivalent to @kbd{C-d}---or it
+should be.
+
+  Why do we say ``or it should be''?  When Emacs starts up using a
+window system, it determines automatically which key or keys should be
+equivalent to @key{DEL}.  So the @key{BACKSPACE} and/or @key{DELETE}
+keys normally do the right things.  But in some unusual cases Emacs
+gets the wrong information from the system.  If these keys don't do
+what they ought to do, you need to tell Emacs which key to use for
+@key{DEL}.  @xref{DEL Gets Help}, for how to do this.
+
+@findex normal-erase-is-backspace-mode
+  On most text-only terminals, Emacs cannot tell which keys the
+keyboard really has, so it follows a uniform plan which may or may not
+fit your keyboard.  The uniform plan is that the ASCII @key{DEL}
+character deletes, and the ASCII @key{BS} (backspace) character asks
+for help (it is the same as @kbd{C-h}).  If this is not right for your
+keyboard, if you find that the key which ought to delete backwards
+enters Help instead, see @ref{DEL Gets Help}.
+
 @kindex M-\
 @findex delete-horizontal-space
 @kindex M-SPC
 @kindex M-\
 @findex delete-horizontal-space
 @kindex M-SPC
@@ -485,8 +538,13 @@ Clear the region-rectangle by replacing its contents with spaces.
 Delete whitespace in each of the lines on the specified rectangle,
 starting from the left edge column of the rectangle.
 @item C-x r t @var{string} @key{RET}
 Delete whitespace in each of the lines on the specified rectangle,
 starting from the left edge column of the rectangle.
 @item C-x r t @var{string} @key{RET}
-Insert @var{string} on each line of the region-rectangle
+Replace rectangle contents with @var{string} on each line.
+(@code{string-rectangle}).
+@item M-x replace-rectangle @key{RET} @var{string} @key{RET}
+Replaces each line of the region-rectangle with @var{string}
 (@code{string-rectangle}).
 (@code{string-rectangle}).
+@item M-x string-insert-rectangle @key{RET} @var{string} @key{RET}
+Insert @var{STRING} on each line of the rectangle.
 @end table
 
   The rectangle operations fall into two classes: commands deleting and
 @end table
 
   The rectangle operations fall into two classes: commands deleting and
@@ -547,9 +605,15 @@ any difference to this command.
 
 @kindex C-x r t
 @findex string-rectangle
 
 @kindex C-x r t
 @findex string-rectangle
+@findex replace-rectangle
   The command @kbd{C-x r t} (@code{M-x string-rectangle}) replaces the
   The command @kbd{C-x r t} (@code{M-x string-rectangle}) replaces the
-rectangle with a specified string (inserted once on each line).  The
+contents of a region-rectangle with a string on each line.  The
 string's width need not be the same as the width of the rectangle.  If
 string's width need not be the same as the width of the rectangle.  If
-the string's width is less, the text after the rectangle shifts left; if
-the string is wider than the rectangle, the text after the rectangle
-shifts right.
+the string's width is less, the text after the rectangle shifts left;
+if the string is wider than the rectangle, the text after the
+rectangle shifts right.
+
+@findex string-insert-rectangle
+  The command @kbd{M-x string-insert-rectangle} is similar to 
+@code{string-rectangle}, but inserts the string on each line, 
+shifting the original text to the right.