]> code.delx.au - gnu-emacs/blobdiff - man/killing.texi
Fix command names dired-do-flagged-delete,
[gnu-emacs] / man / killing.texi
index d790e78bae65fd68ebbe2b3ff15705453e20fa8c..5ade2f214fafb25bf3aa34a5260176d6de1fa79d 100644 (file)
@@ -1,5 +1,5 @@
 @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
@@ -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
-  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
@@ -52,12 +56,13 @@ and @samp{delete} to say which they do.
 @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
@@ -72,14 +77,18 @@ selection and Transient Mark mode is turned on (@pxref{Transient Mark}).
 @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}
@@ -92,6 +101,8 @@ Join two lines by deleting the intervening newline, along with any
 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
@@ -101,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.
 
+@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
@@ -495,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}
-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
@@ -557,13 +605,15 @@ any difference to this command.
 
 @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.