@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
@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
@cindex Delete Selection mode
@cindex mode, Delete Selection
@findex delete-selection-mode
-You can arrange for selected text to be killed when you insert something
-and replaced by what you insert; this is the way many text interfaces
-work. To do this turn on Delete Selection mode. with @kbd{M-x
-delete-selection-mode} or using Custom. Also in Delete Selection mode
-@key{DEL}, @kbd{C-d} and some other keys will just kill the whole
-selection and Transient Mark mode is turned on (@pxref{Transient Mark}).
+ 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
@c ??? Should be backward-delete-char
@findex delete-backward-char
@findex delete-char
-@kindex DEL
-@kindex 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}
-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}
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
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
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}).
+@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
@kindex C-x r t
@findex string-rectangle
-The command @kbd{C-x r t} (@code{M-x string-rectangle}) inserts a
-string on each line of the region-rectangle before the rectangle,
-shifting text right.
-
@findex replace-rectangle
-The command @kbd{M-x replace-rectangle} is similar, but replaces the
-original rectangle. The 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 command @kbd{C-x r t} (@code{M-x string-rectangle}) replaces 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
+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.