Update years in copyright notice; nfc.
[bpt/emacs.git] / man / basic.texi
index 29bf6d4..2f5aa31 100644 (file)
@@ -1,5 +1,6 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001 Free Software Foundation, Inc.
+@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
+@c   2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Basic, Minibuffer, Exiting, Top
 @chapter Basic Editing Commands
@@ -73,7 +74,7 @@ point, the one underneath the cursor, like @kbd{C-d} (see below).
 @cindex newline
    To end a line and start typing a new one, type @key{RET}.  This
 inserts a newline character in the buffer.  If point is in the middle of
-a line, @key{RET} splits the line.  Typing @key{DEL} when the cursor is
+a line, the effect is to split the line.  Typing @key{DEL} when the cursor is
 at the beginning of a line deletes the preceding newline, thus joining
 the line with the preceding line.
 
@@ -170,7 +171,7 @@ them).  Others do more sophisticated things.
 @kindex RIGHT
 @kindex UP
 @kindex DOWN
-@findex beginning-of-line
+@findex move-beginning-of-line
 @findex move-end-of-line
 @findex forward-char
 @findex backward-char
@@ -183,7 +184,7 @@ them).  Others do more sophisticated things.
 @findex move-to-window-line
 @table @kbd
 @item C-a
-Move to the beginning of the line (@code{beginning-of-line}).
+Move to the beginning of the line (@code{move-beginning-of-line}).
 @item C-e
 Move to the end of the line (@code{move-end-of-line}).
 @item C-f
@@ -219,23 +220,31 @@ numeric argument @var{n}, move to @var{n}/10 of the way from the top.
 @item M->
 Move to the end of the buffer (@code{end-of-buffer}).
 @item C-v
-Scroll the display one screen forward, and move point if necessary to put
-it on the screen (@code{scroll-up}).  This doesn't always
-move point, but it is commonly used to do so.
-If your keyboard has a @key{PAGEDOWN} key, it does the same thing.
+@itemx @key{PAGEDOWN}
+@itemx @key{PRIOR}
+Scroll the display one screen forward, and move point if necessary to
+put it on the screen (@code{scroll-up}).  This doesn't always move
+point, but it is commonly used to do so.  If your keyboard has a
+@key{PAGEDOWN} or @key{PRIOR} key, it does the same thing.
 
 Scrolling commands are further described in @ref{Scrolling}.
 @item M-v
+@itemx @key{PAGEUP}
+@itemx @key{NEXT}
 Scroll one screen backward, and move point if necessary to put it on
 the screen (@code{scroll-down}).  This doesn't always move point, but
-it is commonly used to do so.  The @key{PAGEUP} key has the same
-effect.
+it is commonly used to do so.  If your keyboard has a @key{PAGEUP} or
+@key{NEXT} key, it does the same thing.
 @item M-x goto-char
 Read a number @var{n} and move point to buffer position @var{n}.
 Position 1 is the beginning of the buffer.
-@item M-x goto-line
-Read a number @var{n} and move point to line number @var{n}.  Line 1
-is the beginning of the buffer.
+@item M-g M-g
+@itemx M-g g
+@itemx M-x goto-line
+Read a number @var{n} and move point to the beginning of line number
+@var{n}.  Line 1 is the beginning of the buffer.  If point is on or
+just after a number, then that is the default for @var{n}, if you just
+press @key{RET} with an empty minibuffer.
 @item C-x C-n
 @findex set-goal-column
 @kindex C-x C-n
@@ -256,11 +265,11 @@ to the end of another line.  Normally, @code{track-eol} is @code{nil}.
 @xref{Variables}, for how to set variables such as @code{track-eol}.
 
 @vindex next-line-add-newlines
-  @kbd{C-n} normally gets an error when you use it on the last line of
-the buffer (just as @kbd{C-p} gets an error on the first line).  But
-if you set the variable @code{next-line-add-newlines} to a
-non-@code{nil} value, @kbd{C-n} on the last line of a buffer creates
-an additional line at the end and moves down onto it.
+  @kbd{C-n} normally stops at the end of the buffer when you use it on
+the last line of the buffer.  But if you set the variable
+@code{next-line-add-newlines} to a non-@code{nil} value, @kbd{C-n} on
+the last line of a buffer creates an additional line at the end and
+moves down onto it.
 
 @node Erasing
 @section Erasing Text
@@ -319,6 +328,7 @@ tedious.
 @item C-x u
 Undo one batch of changes---usually, one command worth (@code{undo}).
 @item C-_
+@itemx C-/
 The same.
 @item C-u C-x u
 Undo one batch of changes in the region.
@@ -326,33 +336,41 @@ Undo one batch of changes in the region.
 
 @kindex C-x u
 @kindex C-_
+@kindex C-/
 @findex undo
-  The command @kbd{C-x u} or @kbd{C-_} is how you undo.  The first time
-you give this command, it undoes the last change.  Point moves back to
-where it was before the command that made the change.
+  The command @kbd{C-x u} (or @kbd{C-_} or @kbd{C-/}) is how you undo.
+The first time you give this command, it undoes the last change.
+Point moves back to where it was before the command that made the
+change.
 
   Consecutive repetitions of @kbd{C-_} or @kbd{C-x u} undo earlier and
 earlier changes, back to the limit of the undo information available.
 If all recorded changes have already been undone, the undo command
 displays an error message and does nothing.
 
+@findex undo-only
   Any command other than an undo command breaks the sequence of undo
 commands.  Starting from that moment, the previous undo commands become
 ordinary changes that you can undo.  Thus, to redo changes you have
 undone, type @kbd{C-f} or any other command that will harmlessly break
-the sequence of undoing, then type more undo commands.
+the sequence of undoing, then type more undo commands.  On the other
+hand, if you want to ignore previous undo commands, use @kbd{M-x
+undo-only}.  This is like @code{undo}, but will not redo changes
+you have just undone.
 
 @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.
+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, any use
-of @code{undo} when there is an active region performs selective undo;
-you do not need a prefix argument.
+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.
 
   If you notice that a buffer has been modified accidentally, the
 easiest way to recover is to type @kbd{C-_} repeatedly until the stars
@@ -400,18 +418,17 @@ value of @code{undo-strong-limit} is 30000.
   Regardless of the values of those variables, the most recent change
 is never discarded unless it gets bigger than @code{undo-outer-limit}
 (normally 3,000,000).  At that point, Emacs discards the undo data and
-warns you about it.  This is the only situation in which you can not
+warns you about it.  This is the only situation in which you cannot
 undo the last command.  If this happens, you can increase the value of
 @code{undo-outer-limit} to make it even less likely to happen in the
 future.  But if you didn't expect the command to create such large
 undo data, then it is probably a bug and you should report it.
 @xref{Bugs,, Reporting Bugs}.
 
-  The reason the @code{undo} command has two keys, @kbd{C-x u} and
-@kbd{C-_}, set up to run it is that it is worthy of a single-character
-key, but on some keyboards it is not obvious how to type @kbd{C-_}.
-@kbd{C-x u} is an alternative you can type straightforwardly on any
-terminal.
+  The reason the @code{undo} command has three key bindings, @kbd{C-x
+u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a
+single-character key, but @kbd{C-x u} is more straightforward for
+beginners to type.
 
 @node Basic Files
 @section Files
@@ -497,7 +514,7 @@ type the text for the new line.  @kbd{C-o F O O} has the same effect as
 
   You can make several blank lines by typing @kbd{C-o} several times, or
 by giving it a numeric argument to tell it how many blank lines to make.
-@xref{Arguments}, for how.  If you have a fill prefix, then @kbd{C-o}
+@xref{Arguments}, for how.  If you have a fill prefix, the @kbd{C-o}
 command inserts the fill prefix on the new line, when you use it at the
 beginning of a line.  @xref{Fill Prefix}.
 
@@ -536,25 +553,16 @@ character that indicates continuation.
 a line gets too long.  Continuation on the screen does not do that.  Use
 Auto Fill mode (@pxref{Filling}) if that's what you want.
 
-@vindex truncate-lines
 @cindex truncation
 @cindex line truncation, and fringes
   As an alternative to continuation, Emacs can display long lines by
 @dfn{truncation}.  This means that all the characters that do not fit
-in the width of the screen or window do not appear at all.  They
-remain in the buffer, temporarily invisible.  On terminals, @samp{$}
-in the last column informs you that the line has been truncated on the
-display.  On window systems, a small straight arrow in the fringe to
-the right of the window indicates a truncated line.
+in the width of the screen or window do not appear at all.  @samp{$}
+in the last column or a small straight arrow in the fringe to the
+right of the window indicates a truncated line.
 
-@findex toggle-truncate-lines
-  Truncation instead of continuation happens whenever horizontal
-scrolling is in use, and optionally in all side-by-side windows
-(@pxref{Windows}).  You can enable or disable truncation for a
-particular buffer with the command @kbd{M-x toggle-truncate-lines}.
-
-  @xref{Display Custom}, for additional variables that affect how text is
-displayed.
+  @xref{Display Custom}, for more information about line truncation,
+and other variables that affect how text is displayed.
 
 @node Position Info
 @section Cursor Position Information
@@ -591,17 +599,13 @@ Toggle automatic display of the size of the buffer.
 @cindex location of point
 @cindex cursor location
 @cindex point location
-  There are two commands for working with line numbers.  @kbd{M-x
-what-line} computes the current line number and displays it in the echo
-area.  To go to a given line by number, use @kbd{M-x goto-line}; it
-prompts you for the number.  These line numbers count from one at the
-beginning of the buffer.
-
-  You can also see the current line number in the mode line; see @ref{Mode
-Line}.  If you narrow the buffer, then the line number in the mode line
-is relative to the accessible portion (@pxref{Narrowing}).  By contrast,
-@code{what-line} shows both the line number relative to the narrowed
-region and the line number relative to the whole buffer.
+  @kbd{M-x what-line} computes the current line number and displays it
+in the echo area.  You can also see the current line number in the
+mode line; see @ref{Mode Line}.  If you narrow the buffer, then the
+line number in the mode line is relative to the accessible portion
+(@pxref{Narrowing}).  By contrast, @code{what-line} shows both the
+line number relative to the narrowed region and the line number
+relative to the whole buffer.
 
   @kbd{M-x what-page} counts pages from the beginning of the file, and
 counts lines within the page, showing both numbers in the echo area.
@@ -671,36 +675,57 @@ point=26957 of 26956(100%)  column 0
 @cindex character set of character at point
 @cindex font of character at point
 @cindex text properties at point
-  @w{@kbd{C-u C-x =}} displays additional information about a
-character, including the character set name and the codes that
-identify the character within that character set; @acronym{ASCII} characters are
-identified as belonging to the @code{ascii} character set.  It also
-shows the character's syntax, categories, and encodings both
-internally in the buffer and externally if you save the file.  It also
-shows the character's text properties (@pxref{Text Properties,,,
+  @w{@kbd{C-u C-x =}} displays the following additional information about a
+character.
+
+@itemize @bullet
+@item
+The character set name, and the codes that identify the character
+within that character set; @acronym{ASCII} characters are identified
+as belonging to the @code{ascii} character set.
+
+@item
+The character's syntax and categories.
+
+@item
+The character's encodings, both internally in the buffer, and externally
+if you were to save the file.
+
+@item
+What to type to input the character in the current input method
+(if it supports the character).
+
+@item
+If you are running Emacs on a window system, the font name and glyph
+code for the character.  If you are running Emacs on a terminal, the
+code(s) sent to the terminal.
+
+@item
+The character's text properties (@pxref{Text Properties,,,
 elisp, the Emacs Lisp Reference Manual}), and any overlays containing it
 (@pxref{Overlays,,, elisp, the same manual}).
+@end itemize
 
   Here's an example showing the Latin-1 character A with grave accent,
-in a buffer whose coding system is @code{iso-2022-7bit}, whose
+in a buffer whose coding system is @code{iso-latin-1}, whose
 terminal coding system is @code{iso-latin-1} (so the terminal actually
 displays the character as @samp{@`A}), and which has font-lock-mode
 (@pxref{Font Lock}) enabled:
 
 @smallexample
-    character: @`A (04300, 2240, 0x8c0)
-      charset: latin-iso8859-1
-              (Right-Hand Part of Latin Alphabet 1@dots{}
  code point: 64
-       syntax: w       which means: word
-     category: l:Latin
-  buffer code: 0x81 0xC0
-    file code: ESC 2C 41 40 (encoded by coding system iso-2022-7bit)
-terminal code: C0
-
-Text properties
-  font-lock-face: font-lock-variable-name-face
-  fontified: t
+  character: @`A (04300, 2240, 0x8c0, U+00C0)
+    charset: latin-iso8859-1
+             (Right-Hand Part of Latin Alphabet 1@dots{}
+ code point: 64
+     syntax: w         which means: word
+   category: l:Latin
+   to input: type "`A"
+buffer code: 0x81 0xC0
+  file code: ESC 2C 41 40 (encoded by coding system iso-2022-7bit)
+    display: terminal code 0xC0
+
+There are text properties here:
+  fontified            t
 @end smallexample
 
 @node Arguments
@@ -722,9 +747,10 @@ act in the opposite direction.
 @kindex M-@t{-}
 @findex digit-argument
 @findex negative-argument
-  If your terminal keyboard has a @key{META} key, the easiest way to
-specify a numeric argument is to type digits and/or a minus sign while
-holding down the @key{META} key.  For example,
+  If your terminal keyboard has a @key{META} key (labeled @key{ALT} on
+PC keyboards), the easiest way to specify a numeric argument is to
+type digits and/or a minus sign while holding down the @key{META} key.
+For example,
 
 @example
 M-5 C-n
@@ -777,8 +803,9 @@ with an argument of one.  (@xref{Killing}, for more information on
   A few commands treat a plain @kbd{C-u} differently from an ordinary
 argument.  A few others may treat an argument of just a minus sign
 differently from an argument of @minus{}1.  These unusual cases are
-described when they come up; they are always for reasons of convenience
-of use of the individual command.
+described when they come up; they are always for reasons of
+convenience of use of the individual command, and they are documented
+in the command's documentation string.
 
   You can use a numeric argument to insert multiple copies of a
 character.  This is straightforward unless the character is a digit; for