]> code.delx.au - gnu-emacs/blobdiff - man/programs.texi
(Font Lock): Suggest more user-friendly method of
[gnu-emacs] / man / programs.texi
index c4efcf67f6c1c4f093854522fd7b0ef35aeeb8ec..d5b608a288c95fd8d1cca0988190be12c2d61f0f 100644 (file)
@@ -1,5 +1,6 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985,86,87,93,94,95,97,99,00,2001 Free Software Foundation, Inc.
+@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
+@c   2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Programs, Building, Text, Top
 @chapter Editing Programs
@@ -73,23 +74,26 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
 @cindex Metafont mode
 @cindex Modula2 mode
 @cindex Prolog mode
+@cindex Python mode
 @cindex Simula mode
 @cindex VHDL mode
 @cindex M4 mode
 @cindex Shell-script mode
 @cindex Delphi mode
 @cindex PostScript mode
+@cindex Conf mode
+@cindex DNS mode
   The existing programming language major modes include Lisp, Scheme (a
 variant of Lisp) and the Scheme-based DSSSL expression language, Ada,
 ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed
 format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s
 companion for font creation), Modula2, Objective-C, Octave, Pascal,
-Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL.  There is
-also a major mode for makefiles, called Makefile mode.  An alternative
-mode for Perl is called CPerl mode.  Modes are available for the
-scripting languages of the common GNU and Unix shells, VMS DCL, and
+Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL.  An
+alternative mode for Perl is called CPerl mode.  Modes are available for
+the scripting languages of the common GNU and Unix shells, VMS DCL, and
 MS-DOS/MS-Windows @samp{BAT} files.  There are also major modes for
-editing various sorts of configuration files.
+editing makefiles, DNS master files, and various sorts of configuration
+files.
 
 @kindex DEL @r{(programming modes)}
 @findex c-electric-backspace
@@ -241,6 +245,9 @@ which puts point at the beginning and mark at the end of the current
 defun.  This is the easiest way to get ready to kill the defun in
 order to move it to a different place in the file.  If you use the
 command while point is between defuns, it uses the following defun.
+Successive uses of @kbd{C-M-h}, or using it in Transient Mark mode
+when the mark is active, includes an additional defun in the region
+each time.
 
   In C mode, @kbd{C-M-h} runs the function @code{c-mark-function},
 which is almost the same as @code{mark-defun}; the difference is that
@@ -317,7 +324,7 @@ buffer.
   To enable (or disable) Which Function mode, use the command @kbd{M-x
 which-function-mode}.  This command is global; it applies to all
 buffers, both existing ones and those yet to be created.  However, it
-takes effect in only certain major modes, those listed in the value of
+takes effect only in certain major modes, those listed in the value of
 @code{which-func-modes}.  If the value is @code{t}, then Which Function
 mode applies to all major modes that know how to support it---in other
 words, all the major modes that support Imenu.
@@ -365,7 +372,7 @@ This key, if the keyboard has it, is another way to enter @kbd{C-j}.
   The basic indentation command is @key{TAB}, which gives the current line
 the correct indentation as determined from the previous lines.  The
 function that @key{TAB} runs depends on the major mode; it is
-@code{indent-for-tab-command}
+@code{lisp-indent-line}
 in Lisp mode, @code{c-indent-command} in C mode, etc.  These functions
 understand the syntax and conventions of different languages, but they all do
 conceptually the same job: @key{TAB} in any programming-language major mode
@@ -375,7 +382,7 @@ whitespace at the beginning of the line, @key{TAB} puts it at the end of
 that whitespace; otherwise, @key{TAB} keeps point fixed with respect to
 the characters around it.
 
-  Use @kbd{C-q @key{TAB}} to insert a tab at point.
+  Use @kbd{C-q @key{TAB}} to insert a tab character at point.
 
 @kindex C-j
 @findex newline-and-indent
@@ -384,12 +391,13 @@ the characters around it.
 followed by a @key{TAB}.  @kbd{C-j} at the end of a line creates a
 blank line and then gives it the appropriate indentation.
 
-  @key{TAB} indents lines that start within a parenthetical grouping
-each under the preceding line (or the text after the parenthesis).
-Therefore, if you manually give one of these lines a nonstandard
-indentation, the lines below will tend to follow it.  This behavior is
-convenient in cases where you have overridden the standard result of
-@key{TAB} because you find it unaesthetic for a particular line.
+  @key{TAB} indents a line that starts within a parenthetical grouping
+under the preceding line within the grouping, or the text after the
+parenthesis.  Therefore, if you manually give one of these lines a
+nonstandard indentation, the lines below will tend to follow it.  This
+behavior is convenient in cases where you have overridden the standard
+result of @key{TAB} because you find it unaesthetic for a particular
+line.
 
   Remember that an open-parenthesis, open-brace or other opening delimiter
 at the left margin is assumed by Emacs (including the indentation routines)
@@ -411,7 +419,7 @@ you have several commands available.
 
 @table @kbd
 @item C-M-q
-Reindent all the lines within one parenthetical grouping(@code{indent-sexp}).
+Reindent all the lines within one parenthetical grouping (@code{indent-pp-sexp}).
 @item C-M-\
 Reindent all lines in the region (@code{indent-region}).
 @item C-u @key{TAB}
@@ -423,12 +431,12 @@ lines that start inside comments and strings.
 @end table
 
 @kindex C-M-q
-@findex indent-sexp
+@findex indent-pp-sexp
   You can reindent the contents of a single parenthetical grouping by
 positioning point before the beginning of it and typing @kbd{C-M-q}
-(@code{indent-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also
+(@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also
 bound to other suitable commands in other modes).  The indentation of
-the line where the grouping starts is not changed; therefore it
+the line where the grouping starts is not changed; therefore this
 changes only the relative indentation within the grouping, not its
 overall indentation.  To correct that as well, type @key{TAB} first.
 
@@ -455,6 +463,7 @@ to them.
 region sideways, like @code{indent-rigidly} does (@pxref{Indentation
 Commands}).  It doesn't alter the indentation of lines that start
 inside a string, unless the region also starts inside that string.
+The prefix arg specifies the number of columns to indent.
 
 @node Lisp Indent
 @subsection Customizing Lisp Indentation
@@ -585,10 +594,11 @@ example,
 
 @noindent
 specifies an explicit choice for Java mode, and the default @samp{gnu}
-style for the other C-like modes.  This variable takes effect when you
-select one of the C-like major modes; thus, if you specify a new
-default style for Java mode, you can make it take effect in an
-existing Java mode buffer by typing @kbd{M-x java-mode} there.
+style for the other C-like modes.  (These settings are actually the
+defaults.)  This variable takes effect when you select one of the
+C-like major modes; thus, if you specify a new default style for Java
+mode, you can make it take effect in an existing Java mode buffer by
+typing @kbd{M-x java-mode} there.
 
   The @code{gnu} style specifies the formatting recommended by the GNU
 Project for C; it is the default, so as to encourage use of our
@@ -711,8 +721,10 @@ at or after point and the mark.
 use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place
 that @kbd{C-M-f} would move to.  @kbd{C-M-@@} takes arguments like
 @kbd{C-M-f}.  In particular, a negative argument is useful for putting
-the mark at the beginning of the previous balanced expression.
-The alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}.
+the mark at the beginning of the previous balanced expression.  The
+alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}.  If you use
+this command repeatedly, or in Transient Mark mode whenever the mark
+is active, it extends the region by one sexp each time.
 
   In languages that use infix operators, such as C, it is not possible
 to recognize all balanced expressions as such because there can be
@@ -797,8 +809,9 @@ as in @samp{[x)}---a warning message is displayed in the echo area.
 @vindex blink-matching-paren
 @vindex blink-matching-paren-distance
 @vindex blink-matching-delay
-  Three variables control parenthesis match display.
-@code{blink-matching-paren} turns the feature on or off: @code{nil}
+  Three variables control parenthesis match display:
+
+  @code{blink-matching-paren} turns the feature on or off: @code{nil}
 disables it, but the default is @code{t} to enable match display.
 
   @code{blink-matching-delay} says how many seconds to leave the
@@ -1003,7 +1016,7 @@ for example, in C mode the value of the variable is
 after the @samp{/*} itself, and accepts C++ style comments also.
 (Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in
 the string, which is needed to deny the first star its special meaning
-in regexp syntax.  @xref{Regexps}.)
+in regexp syntax.  @xref{Regexp Backslash}.)
 
 @vindex comment-start
 @vindex comment-end
@@ -1064,9 +1077,10 @@ use in your program.
 @kindex C-h S
   For C, Lisp, and other languages that have documentation in Info,
 you can use @kbd{C-h S} (@code{info-lookup-symbol}) to view the Info
-documentation for a symbol.  You specify the symbol with the
-minibuffer; the default is the symbol appearing in the buffer at
-point.
+documentation for a symbol used in the program.  You specify the
+symbol with the minibuffer; the default is the symbol appearing in the
+buffer at point.  For example, in C mode this looks for the symbol in
+the C Library Manual.
 
   The major mode determines where to look for documentation for the
 symbol---which Info files to look in, and which indices to search.
@@ -1220,9 +1234,11 @@ v} uses the symbol name around or adjacent to point as its default.
 mode constantly displays in the echo area the argument list for the
 function being called at point.  (In other words, it finds the
 function call that point is contained in, and displays the argument
-list of that function.)  Eldoc mode applies in Emacs Lisp and Lisp
-Interaction modes only.  Use the command @kbd{M-x eldoc-mode} to
-enable or disable this feature.
+list of that function.)  If point is over a documented variable, it
+shows the first line of the variable's docstring.  Eldoc mode applies
+in Emacs Lisp and Lisp Interaction modes, and perhaps a few others
+that provide special support for looking up doc strings.  Use the
+command @kbd{M-x eldoc-mode} to enable or disable this feature.
 
 @node Hideshow
 @section Hideshow minor mode
@@ -1274,7 +1290,7 @@ Hide all blocks @var{n} levels below this block
 @vindex hs-hide-comments-when-hiding-all
 @vindex hs-isearch-open
 @vindex hs-special-modes-alist
-  These user options exist for customizing Hideshow mode.
+  These variables exist for customizing Hideshow mode.
 
 @table @code
 @item hs-hide-comments-when-hiding-all
@@ -1313,7 +1329,9 @@ symbol names.
   The character @kbd{M-@key{TAB}} runs a command to complete the
 partial symbol before point against the set of meaningful symbol
 names.  This command inserts at point any additional characters that
-it can determine from the partial name.
+it can determine from the partial name.  (If your window manager
+defines @kbd{M-@key{TAB}} to switch windows, you can type
+@kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.)
 
   If the partial name in the buffer has multiple possible completions
 that differ in the very next character, so that it is impossible to
@@ -1510,10 +1528,10 @@ With prefix argument @var{n}, move @var{n} times.
 
   In C mode and related modes, certain printing characters are
 ``electric''---in addition to inserting themselves, they also reindent
-the current line and may insert newlines.  This feature is controlled by
-the variable @code{c-auto-newline}.  The ``electric'' characters are
-@kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#}, @kbd{;}, @kbd{,}, @kbd{<},
-@kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and @kbd{)}.
+the current line, and optionally also insert newlines.  The
+``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#},
+@kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and
+@kbd{)}.
 
   Electric characters insert newlines only when the @dfn{auto-newline}
 feature is enabled (indicated by @samp{/a} in the mode line after the
@@ -1735,8 +1753,8 @@ click on @samp{[A]pply these settings} (or go to that buffer and type
 @findex c-show-syntactic-information
 @kindex C-c C-s @r{(C mode)}
 Display the syntactic information about the current source line
-(@code{c-show-syntactic-information}).  This is the information that
-directs how the line is indented.
+(@code{c-show-syntactic-information}).  This information directs how
+the line is indented.
 
 @item M-x cwarn-mode
 @itemx M-x global-cwarn-mode
@@ -1787,11 +1805,11 @@ names.
 @cindex Fortran mode
 @cindex mode, Fortran
 
-  Fortran mode provides special motion commands for Fortran statements and
-subprograms, and indentation commands that understand Fortran conventions
-of nesting, line numbers and continuation statements.  Fortran mode has
-its own Auto Fill mode that breaks long lines into proper Fortran
-continuation lines.
+  Fortran mode provides special motion commands for Fortran statements
+and subprograms, and indentation commands that understand Fortran
+conventions of nesting, line numbers and continuation statements.
+Fortran mode has support for Auto Fill mode that breaks long lines into
+proper Fortran continuation lines.
 
   Special commands for comments are provided because Fortran comments
 are unlike those of other languages.  Built-in abbrevs optionally save
@@ -1803,18 +1821,18 @@ runs the hook @code{fortran-mode-hook} (@pxref{Hooks}).
 @cindex Fortran77 and Fortran90
 @findex f90-mode
 @findex fortran-mode
-  Fortran mode is meant for editing Fortran77 ``fixed format'' source
-code.  For editing the modern Fortran90 ``free format'' source code,
-use F90 mode (@code{f90-mode}).  Emacs normally uses Fortran mode for
-files with extension @samp{.f}, @samp{.F} or @samp{.for}, and F90 mode
-for the extension @samp{.f90}.  GNU Fortran supports both kinds of
-format.
+  Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
+``tab format'') source code.  For editing the modern Fortran90 or
+Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
+Emacs normally uses Fortran mode for files with extension @samp{.f},
+@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
+@samp{.f95}.  GNU Fortran supports both kinds of format.
 
 @menu
 * Motion: Fortran Motion.       Moving point by statements or subprograms.
 * Indent: Fortran Indent.       Indentation commands for Fortran.
 * Comments: Fortran Comments.   Inserting and aligning comments.
-* Autofill: Fortran Autofill.   Auto fill minor mode for Fortran.
+* Autofill: Fortran Autofill.   Auto fill support for Fortran.
 * Columns: Fortran Columns.     Measuring columns for valid Fortran.
 * Abbrev: Fortran Abbrev.       Built-in abbrevs for Fortran keywords.
 @end menu
@@ -1823,21 +1841,61 @@ format.
 @subsection Motion Commands
 
   In addition to the normal commands for moving by and operating on
-``defuns'' (Fortran subprograms---functions and subroutines), Fortran
-mode provides special commands to move by statements.
+``defuns'' (Fortran subprograms---functions and subroutines, as well as
+modules for F90 mode), Fortran mode provides special commands to move by
+statements and other program units.
 
 @table @kbd
 @kindex C-c C-n @r{(Fortran mode)}
 @findex fortran-next-statement
+@findex f90-next-statement
 @item C-c C-n
-Move to beginning of current or next statement
-(@code{fortran-next-statement}).
+Move to the beginning of the next statement
+(@code{fortran-next-statement}/@code{f90-next-statement}).
 
 @kindex C-c C-p @r{(Fortran mode)}
 @findex fortran-previous-statement
+@findex f90-previous-statement
 @item C-c C-p
-Move to beginning of current or previous statement
-(@code{fortran-previous-statement}).
+Move to the beginning of the previous statement
+(@code{fortran-previous-statement}/@code{f90-previous-statement}).
+If there is no previous statement (i.e. if called from the first
+statement in the buffer), move to the start of the buffer.
+
+@kindex C-c C-e @r{(F90 mode)}
+@findex f90-next-block
+@item C-c C-e
+Move point forward to the start of the next code block
+(@code{f90-next-block}).  A code block is a subroutine,
+@code{if}--@code{endif} statement, and so forth.  This command exists
+for F90 mode only, not Fortran mode.  With a numeric argument, this
+moves forward that many blocks.
+
+@kindex C-c C-a @r{(F90 mode)}
+@findex f90-previous-block
+@item C-c C-a
+Move point backward to the previous code block
+(@code{f90-previous-block}).  This is like @code{f90-next-block}, but
+moves backwards.
+
+@kindex C-M-n @r{(Fortran mode)}
+@findex fortran-end-of-block
+@findex f90-end-of-block
+@item C-M-n
+Move to the end of the current code block
+(@code{fortran-end-of-block}/@code{f90-end-of-block}).  With a numeric
+agument, move forward that number of blocks.  The mark is set before
+moving point.  The F90 mode version of this command checks for
+consistency of block types and labels (if present), but it does not
+check the outermost block since that may be incomplete.
+
+@kindex C-M-p @r{(Fortran mode)}
+@findex fortran-beginning-of-block
+@findex f90-beginning-of-block
+@item C-M-p
+Move to the start of the current code block
+(@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
+is like @code{fortran-end-of-block}, but moves backwards.
 @end table
 
 @node Fortran Indent
@@ -1846,7 +1904,7 @@ Move to beginning of current or previous statement
   Special commands and features are needed for indenting Fortran code in
 order to make sure various syntactic entities (line numbers, comment line
 indicators and continuation line flags) appear in the columns that are
-required for standard Fortran.
+required for standard, fixed (or tab) format Fortran.
 
 @menu
 * Commands: ForIndent Commands.  Commands for indenting and filling Fortran.
@@ -1861,7 +1919,7 @@ required for standard Fortran.
 
 @table @kbd
 @item C-M-j
-Break the current line and set up a continuation line
+Break the current line at point and set up a continuation line
 (@code{fortran-split-line}).
 @item M-^
 Join this line to the previous line (@code{fortran-join-line}).
@@ -1903,30 +1961,39 @@ point is in.  This removes any excess statement continuations.
 @cindex Fortran continuation lines
 
 @vindex fortran-continuation-string
-  Most modern Fortran compilers allow two ways of writing continuation
-lines.  If the first non-space character on a line is in column 5, then
-that line is a continuation of the previous line.  We call this
-@dfn{fixed format}.  (In GNU Emacs we always count columns from 0.)  The
-variable @code{fortran-continuation-string} specifies what character to
-put on column 5.  A line that starts with a tab character followed by
-any digit except @samp{0} is also a continuation line.  We call this
-style of continuation @dfn{tab format}.
+  Most Fortran77 compilers allow two ways of writing continuation lines.
+If the first non-space character on a line is in column 5, then that
+line is a continuation of the previous line.  We call this @dfn{fixed
+format}.  (In GNU Emacs we always count columns from 0; but note that
+the Fortran standard counts from 1.)  The variable
+@code{fortran-continuation-string} specifies what character to put in
+column 5.  A line that starts with a tab character followed by any digit
+except @samp{0} is also a continuation line.  We call this style of
+continuation @dfn{tab format}.  (Fortran90 introduced ``free format'',
+with another style of continuation lines).
 
 @vindex indent-tabs-mode @r{(Fortran mode)}
-  Fortran mode can make either style of continuation line, but you
-must specify which one you prefer.  The value of the variable
-@code{indent-tabs-mode} controls the choice: @code{nil} for fixed
-format, and non-@code{nil} for tab format.  You can tell which style
-is presently in effect by the presence or absence of the string
-@samp{Tab} in the mode line.
-
-  If the text on a line starts with the conventional Fortran
-continuation marker @samp{$}, or if it begins with any non-whitespace
-character in column 5, Fortran mode treats it as a continuation line.
-When you indent a continuation line with @key{TAB}, it converts the line
-to the current continuation style.  When you split a Fortran statement
-with @kbd{C-M-j}, the continuation marker on the newline is created
-according to the continuation style.
+@vindex fortran-analyze-depth
+@vindex fortran-tab-mode-default
+  Fortran mode can use either style of continuation line.  When you
+enter Fortran mode, it tries to deduce the proper continuation style
+automatically from the buffer contents.  It does this by scanning up to
+@code{fortran-analyze-depth} (default 100) lines from the start of the
+buffer.  The first line that begins with either a tab character or six
+spaces determines the choice.  If the scan fails (for example, if the
+buffer is new and therefore empty), the value of
+@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
+non-@code{nil} for tab format) is used.  @samp{/t} in the mode line
+indicates tab format is selected.  Fortran mode sets the value of
+@code{indent-tabs-mode} accordingly (@pxref{Just Spaces}).
+
+  If the text on a line starts with the Fortran continuation marker
+@samp{$}, or if it begins with any non-whitespace character in column
+5, Fortran mode treats it as a continuation line.  When you indent a
+continuation line with @key{TAB}, it converts the line to the current
+continuation style.  When you split a Fortran statement with
+@kbd{C-M-j}, the continuation marker on the newline is created according
+to the continuation style.
 
   The setting of continuation style affects several other aspects of
 editing in Fortran mode.  In fixed format mode, the minimum column
@@ -1936,17 +2003,6 @@ space character for whitespace.  In tab format mode, the minimum
 column number for the statement body is 8, and the whitespace before
 column 8 must always consist of one tab character.
 
-@vindex fortran-tab-mode-default
-@vindex fortran-analyze-depth
-  When you enter Fortran mode for an existing file, it tries to deduce the
-proper continuation style automatically from the file contents.  The first
-line that begins with either a tab character or six spaces determines the
-choice.  The variable @code{fortran-analyze-depth} specifies how many lines
-to consider (at the beginning of the file); if none of those lines
-indicates a style, then the variable @code{fortran-tab-mode-default}
-specifies the style.  If it is @code{nil}, that specifies fixed format, and
-non-@code{nil} specifies tab format.
-
 @node ForIndent Num
 @subsubsection Line Numbers
 
@@ -1957,15 +2013,17 @@ through 4.  (Columns always count from 0 in GNU Emacs.)
 @vindex fortran-line-number-indent
   Line numbers of four digits or less are normally indented one space.
 The variable @code{fortran-line-number-indent} controls this; it
-specifies the maximum indentation a line number can have.  Line numbers
-are right-justified to end in column 4 unless that would require more
-than this maximum indentation.  The default value of the variable is 1.
+specifies the maximum indentation a line number can have.  The default
+value of the variable is 1.  Fortran mode tries to prevent line number
+digits passing column 4, reducing the indentation below the specified
+maximum if necessary.  If @code{fortran-line-number-indent} has the
+value 5, line numbers are right-justified to end in column 4.
 
 @vindex fortran-electric-line-number
   Simply inserting a line number is enough to indent it according to
 these rules.  As each digit is inserted, the indentation is recomputed.
 To turn off this feature, set the variable
-@code{fortran-electric-line-number} to @code{nil}.  
+@code{fortran-electric-line-number} to @code{nil}.
 
 
 @node ForIndent Conv
@@ -2012,58 +2070,63 @@ followed.
 Extra indentation within each level of @samp{do} statement (default 3).
 
 @item fortran-if-indent
-Extra indentation within each level of @samp{if} statement (default 3).
-This value is also used for extra indentation within each level of the
-Fortran 90 @samp{where} statement.
+Extra indentation within each level of @samp{if}, @samp{select case}, or
+@samp{where} statements (default 3).
 
 @item fortran-structure-indent
-Extra indentation within each level of @samp{structure}, @samp{union}, or
-@samp{map} statements (default 3).
+Extra indentation within each level of @samp{structure}, @samp{union},
+@samp{map}, or @samp{interface} statements (default 3).
 
 @item fortran-continuation-indent
 Extra indentation for bodies of continuation lines (default 5).
 
 @item fortran-check-all-num-for-matching-do
-If this is @code{nil}, indentation assumes that each @samp{do} statement
-ends on a @samp{continue} statement.  Therefore, when computing
-indentation for a statement other than @samp{continue}, it can save time
-by not checking for a @samp{do} statement ending there.  If this is
-non-@code{nil}, indenting any numbered statement must check for a
-@samp{do} that ends there.  The default is @code{nil}.
+In Fortran77, a numbered @samp{do} statement is ended by any statement
+with a matching line number.  It is common (but not compulsory) to use a
+@samp{continue} statement for this purpose.  If this variable has a
+non-@code{nil} value, indenting any numbered statement must check for a
+@samp{do} that ends there.  If you always end @samp{do} statements with
+a @samp{continue} line (or if you use the more modern @samp{enddo}),
+then you can speed up indentation by setting this variable to
+@code{nil}.  The default is @code{nil}.
 
 @item fortran-blink-matching-if
-If this is @code{t}, indenting an @samp{endif} statement moves the
-cursor momentarily to the matching @samp{if} statement to show where it
-is.  The default is @code{nil}.
+If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
+statement moves the cursor momentarily to the matching @samp{if} (or
+@samp{do}) statement to show where it is.  The default is @code{nil}.
 
 @item fortran-minimum-statement-indent-fixed
-Minimum indentation for fortran statements when using fixed format
+Minimum indentation for Fortran statements when using fixed format
 continuation line style.  Statement bodies are never indented less than
 this much.  The default is 6.
 
 @item fortran-minimum-statement-indent-tab
-Minimum indentation for fortran statements for tab format continuation line
+Minimum indentation for Fortran statements for tab format continuation line
 style.  Statement bodies are never indented less than this much.  The
 default is 8.
 @end table
 
+The variables controlling the indentation of comments are described in
+the following section.
+
 @node Fortran Comments
 @subsection Fortran Comments
 
-  The usual Emacs comment commands assume that a comment can follow a line
-of code.  In Fortran, the standard comment syntax requires an entire line
-to be just a comment.  Therefore, Fortran mode replaces the standard Emacs
-comment commands and defines some new variables.
+  The usual Emacs comment commands assume that a comment can follow a
+line of code.  In Fortran77, the standard comment syntax requires an
+entire line to be just a comment.  Therefore, Fortran mode replaces the
+standard Emacs comment commands and defines some new variables.
 
+@vindex fortran-comment-line-start
   Fortran mode can also handle the Fortran90 comment syntax where comments
 start with @samp{!} and can follow other text.  Because only some Fortran77
 compilers accept this syntax, Fortran mode will not insert such comments
 unless you have said in advance to do so.  To do this, set the variable
-@code{comment-start} to @samp{"!"} (@pxref{Variables}).
+@code{fortran-comment-line-start} to @samp{"!"}.
 
 @table @kbd
 @item M-;
-Align comment or insert new comment (@code{fortran-comment-indent}).
+Align comment or insert new comment (@code{fortran-indent-comment}).
 
 @item C-x ;
 Applies to nonstandard @samp{!} comments only.
@@ -2073,8 +2136,9 @@ Turn all lines of the region into comments, or (with argument) turn them back
 into real code (@code{fortran-comment-region}).
 @end table
 
+@findex fortran-indent-comment
   @kbd{M-;} in Fortran mode is redefined as the command
-@code{fortran-comment-indent}.  Like the usual @kbd{M-;} command, this
+@code{fortran-indent-comment}.  Like the usual @kbd{M-;} command, this
 recognizes any kind of existing comment and aligns its text appropriately;
 if there is no existing comment, a comment is inserted and aligned.  But
 inserting and aligning comments are not the same in Fortran mode as in
@@ -2128,14 +2192,6 @@ never be indented at all, no matter what the value of
 lines are directives.  Matching lines are never indented, and receive
 distinctive font-locking.
 
-@vindex comment-line-start
-@vindex comment-line-start-skip
-  Fortran mode introduces two variables @code{comment-line-start} and
-@code{comment-line-start-skip}, which play for full-line comments the same
-roles played by @code{comment-start} and @code{comment-start-skip} for
-ordinary text-following comments.  Normally these are set properly by
-Fortran mode, so you do not need to change them.
-
   The normal Emacs comment command @kbd{C-x ;} has not been redefined.  If
 you use @samp{!} comments, this command can be used with them.  Otherwise
 it is useless in Fortran mode.
@@ -2154,38 +2210,28 @@ of the name never conflict because in Lisp and in Emacs it is always
 clear from the context which one is meant.
 
 @node Fortran Autofill
-@subsection Fortran Auto Fill Mode
-
-  Fortran Auto Fill mode is a minor mode which automatically splits
-Fortran statements as you insert them when they become too wide.
-Splitting a statement involves making continuation lines using
-@code{fortran-continuation-string} (@pxref{ForIndent Cont}).  This
-splitting happens when you type @key{SPC}, @key{RET}, or @key{TAB}, and
-also in the Fortran indentation commands.
-
-@findex fortran-auto-fill-mode
-  @kbd{M-x fortran-auto-fill-mode} turns Fortran Auto Fill mode on if it
-was off, or off if it was on.  This command works the same as @kbd{M-x
-auto-fill-mode} does for normal Auto Fill mode (@pxref{Filling}).  A
-positive numeric argument turns Fortran Auto Fill mode on, and a
-negative argument turns it off.  You can see when Fortran Auto Fill mode
-is in effect by the presence of the word @samp{Fill} in the mode line,
-inside the parentheses.  Fortran Auto Fill mode is a minor mode, turned
-on or off for each buffer individually.  @xref{Minor Modes}.
+@subsection Auto Fill in Fortran Mode
+
+  Fortran mode has specialized support for Auto Fill mode, which is a
+minor mode that automatically splits statements as you insert them when
+they become too wide.  Splitting a statement involves making
+continuation lines using @code{fortran-continuation-string}
+(@pxref{ForIndent Cont}).  This splitting happens when you type
+@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran indentation
+commands.  You activate Auto Fill in Fortran mode in the normal way
+(@pxref{Auto Fill}).
 
 @vindex fortran-break-before-delimiters
-   Fortran Auto Fill mode breaks lines at spaces or delimiters when the
-lines get longer than the desired width (the value of @code{fill-column}).
-The delimiters that Fortran Auto Fill mode may break at are @samp{,},
-@samp{'}, @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, and @samp{)}.
-The line break comes after the delimiter if the variable
-@code{fortran-break-before-delimiters} is @code{nil}.  Otherwise (and by
-default), the break comes before the delimiter.
-
-  By default, Fortran Auto Fill mode is not enabled.  If you want this
-feature turned on permanently, add a hook function to
-@code{fortran-mode-hook} to execute @code{(fortran-auto-fill-mode 1)}.
-@xref{Hooks}.
+   Auto Fill breaks lines at spaces or delimiters when the lines get
+longer than the desired width (the value of @code{fill-column}).  The
+delimiters (besides whitespace) that Auto Fill can break at are
+@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
+and @samp{,}.  The line break comes after the delimiter if the
+variable @code{fortran-break-before-delimiters} is @code{nil}.
+Otherwise (and by default), the break comes before the delimiter.
+
+  To enable Auto Fill in all Fortran buffers, add
+@code{turn-on-auto-fill} to @code{fortran-mode-hook}.  @xref{Hooks}.
 
 @node Fortran Columns
 @subsection Checking Columns in Fortran
@@ -2234,7 +2280,7 @@ display.
 @findex fortran-window-create-momentarily
   @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
 splits the current window horizontally, making a window 72 columns
-wide, so you can see which lines that is too long.  Type a space to
+wide, so you can see any lines that are too long.  Type a space to
 restore the normal width.
 
 @kindex C-u C-c C-w @r{(Fortran mode)}