]> code.delx.au - gnu-emacs/blobdiff - man/programs.texi
(Program Modes): Replace inforef to emacs-xtra by conditional xref's, depending
[gnu-emacs] / man / programs.texi
index 7262523fdc6ad2c79d78a58235629385d6860560..63b694f2709e994ddee2d13bf90560a05bf8f2aa 100644 (file)
@@ -1,6 +1,6 @@
 @c This is part of the Emacs manual.
 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
-@c               2001, 2005  Free Software Foundation, Inc.
+@c   2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Programs, Building, Text, Top
 @chapter Editing Programs
@@ -41,8 +41,10 @@ Highlight program syntax (@pxref{Font Lock}).
 * Misc for Programs::   Other Emacs features useful for editing programs.
 * C Modes::             Special commands of C, C++, Objective-C,
                           Java, and Pike modes.
-* Fortran::             Fortran mode and its special features.
 * Asm Mode::            Asm mode and its special features.
+@ifnottex
+* Fortran::             Fortran mode and its special features.
+@end ifnottex
 @end menu
 
 @node Program Modes
@@ -109,7 +111,15 @@ tab character before point, in these modes.
   Separate manuals are available for the modes for Ada (@pxref{Top, , Ada
 Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
 (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes
-(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}).
+(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}).  For Fortran
+mode, see
+@iftex
+@ref{Fortran,,, emacs-xtra}.
+@end iftex
+@ifnottex
+@ref{Fortran}.
+@end ifnottex
+
 
 @cindex mode hook
 @vindex c-mode-hook
@@ -128,20 +138,9 @@ place to set up customizations for that major mode.  @xref{Hooks}.
 @node Defuns
 @section Top-Level Definitions, or Defuns
 
-  In Emacs, a major definition at the top level in the buffer is
-called a @dfn{defun}.  The name comes from Lisp, but in Emacs we use
-it for all languages.
-
-  In most programming language modes, Emacs assumes that a defun is
-any pair of parentheses (or braces, if the language uses braces this
-way) that starts at the left margin.  For example, in C, the body of a
-function definition is normally a defun, because the open-brace that
-begins it is normally at the left margin.  A variable's initializer
-can also count as a defun, if the open-brace that begins the
-initializer is at the left margin.
-
-  However, some language modes provide their own code for recognizing
-defuns in a way that suits the language syntax and conventions better.
+  In Emacs, a major definition at the top level in the buffer,
+something like a function, is called a @dfn{defun}.  The name comes
+from Lisp, but in Emacs we use it for all languages.
 
 @menu
 * Left Margin Paren::   An open-paren or similar opening delimiter
@@ -156,14 +155,24 @@ defuns in a way that suits the language syntax and conventions better.
 
 @cindex open-parenthesis in leftmost column
 @cindex ( in leftmost column
-  In most major modes, Emacs assumes that any opening delimiter found
-at the left margin is the start of a top-level definition, or defun.
-Therefore, @strong{never put an opening delimiter at the left margin
-unless it should have that significance.}  For instance, never put an
+  Emacs assumes by default that any opening delimiter found at the
+left margin is the start of a top-level definition, or defun.  You can
+override this default by setting this user option:
+
+@defvar open-paren-in-column-0-is-defun-start
+If this user option is set to @code{t} (the default), opening
+parentheses or braces at column zero always start defuns.  When it's
+@code{nil}, defuns are found by searching for parens or braces at the
+outermost level.  Some major modes, including C and related modes, set
+@code{open-paren-in-column-0-is-defun-start} buffer-locally to
+@code{nil}
+@end defvar
+
+  In modes where @code{open-paren-in-column-0-is-defun-start} is
+@code{t}, @strong{don't put an opening delimiter at the left margin
+unless it is a defun start}.  For instance, never put an
 open-parenthesis at the left margin in a Lisp file unless it is the
-start of a top-level list.  Never put an open-brace or other opening
-delimiter at the beginning of a line of C code unless it is at top
-level.
+start of a top-level list.
 
   If you don't follow this convention, not only will you have trouble
 when you explicitly use the commands for motion by defuns; other
@@ -173,10 +182,10 @@ mode (@pxref{Font Lock}).
 
   The most likely problem case is when you want an opening delimiter
 at the start of a line inside a string.  To avoid trouble, put an
-escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some
-other Lisp dialects) before the opening delimiter.  This will not
-affect the contents of the string, but will prevent that opening
-delimiter from starting a defun.  Here's an example:
+escape character (@samp{\}, in Emacs Lisp, @samp{/} in some other Lisp
+dialects) before the opening delimiter.  This will not affect the
+contents of the string, but will prevent that opening delimiter from
+starting a defun.  Here's an example:
 
 @example
   (insert "Foo:
@@ -195,8 +204,9 @@ the beginning of the buffer, even for a small function.  To speed up
 the operation, we changed Emacs to assume that any opening delimiter
 at the left margin is the start of a defun.  This heuristic is nearly
 always right, and avoids the need to scan back to the beginning of the
-buffer.  However, it mandates following the convention described
-above.
+buffer.  However, now that modern computers are so powerful, this
+scanning is rarely slow enough to annoy, so we've provided a way to
+disable the heuristic.
 
 @node Moving by Defuns
 @subsection Moving by Defuns
@@ -246,8 +256,8 @@ 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.
+when the mark is active, extends the end of the region to include one
+more defun 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
@@ -283,9 +293,9 @@ name.  You can also add the buffer's index to the menu bar by calling
 @code{imenu-add-menubar-index}.  If you want to have this menu bar
 item available for all buffers in a certain major mode, you can do
 this by adding @code{imenu-add-menubar-index} to its mode hook.  But
-if you have done that, you will have to wait each time you visit a
-file in that mode, while Emacs finds all the definitions in that
-buffer.
+if you have done that, you will have to wait a little while each time
+you visit a file in that mode, while Emacs finds all the definitions
+in that buffer.
 
 @vindex imenu-auto-rescan
   When you change the contents of a buffer, if you add or delete
@@ -360,9 +370,8 @@ usual conventions of the language you are editing.
 @item @key{TAB}
 Adjust indentation of current line.
 @item C-j
-Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
-@item @key{LINEFEED}
-This key, if the keyboard has it, is another way to enter @kbd{C-j}.
+Insert a newline, then adjust indentation of following line
+(@code{newline-and-indent}).
 @end table
 
 @kindex TAB @r{(programming modes)}
@@ -387,9 +396,11 @@ the characters around it.
 @kindex C-j
 @findex newline-and-indent
   When entering lines of new code, use @kbd{C-j}
-(@code{newline-and-indent}), which is equivalent to a @key{RET}
-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.
+(@code{newline-and-indent}), which inserts a newline and then adjusts
+indentation after it.  (It also deletes any trailing whitespace which
+remains before the new newline.)  Thus, @kbd{C-j} at the end of a line
+creates a blank line with appropriate indentation.  In programming
+language modes, it is equivalent to @key{RET} @key{TAB}.
 
   @key{TAB} indents a line that starts within a parenthetical grouping
 under the preceding line within the grouping, or the text after the
@@ -399,16 +410,17 @@ 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)
-to be the start of a function.  Therefore, you must never have an opening
-delimiter in column zero that is not the beginning of a function, not even
-inside a string.  This restriction is vital for making the indentation
-commands fast; you must simply accept it.  @xref{Left Margin Paren},
-for more information on this.
+  In some modes, an open-parenthesis, open-brace or other opening
+delimiter at the left margin is assumed by Emacs (including the
+indentation routines) to be the start of a function.  This speeds up
+indentation commands.  If you will be editing text which contains
+opening delimiters in column zero that aren't the beginning of a
+functions, even inside strings or comments, you must set
+@code{open-paren-in-column-0-is-defun-start}.  @xref{Left Margin
+Paren}, for more information on this.
 
   Normally, lines are indented with tabs and spaces.  If you want Emacs
-to use spaces only, see @ref{Just Spaces}.
+to use spaces only, set @code{indent-tabs-mode} (@pxref{Just Spaces}).
 
 @node Multi-line Indent
 @subsection Indenting Several Lines
@@ -560,25 +572,25 @@ onto the indentation of the @dfn{anchor statement}.
 Select a predefined style @var{style} (@code{c-set-style}).
 @end table
 
-  A @dfn{style} is a named collection of customizations that can
-be used in C mode and the related modes.  Emacs comes with several
+  A @dfn{style} is a named collection of customizations that can be
+used in C mode and the related modes.  @ref{Styles,,, ccmode, The CC
+Mode Manual}, for a complete description.  Emacs comes with several
 predefined styles, including @code{gnu}, @code{k&r}, @code{bsd},
 @code{stroustrup}, @code{linux}, @code{python}, @code{java},
-@code{whitesmith}, @code{ellemtel}, @code{cc-mode}, and @code{user}.
-Some of these styles are primarily intended for one language, but any
-of them can be used with any of the languages supported by these
-modes.  To find out what a style looks like, select it and reindent
-some code, e.g., by typing @key{C-M-q} at the start of a function
-definition.
+@code{whitesmith}, @code{ellemtel}, and @code{awk}.  Some of these
+styles are primarily intended for one language, but any of them can be
+used with any of the languages supported by these modes.  To find out
+what a style looks like, select it and reindent some code, e.g., by
+typing @key{C-M-q} at the start of a function definition.
 
 @kindex C-c . @r{(C mode)}
 @findex c-set-style
-  To choose a style for the current buffer, use the command @kbd{C-c
-.}.  Specify a style name as an argument (case is not significant).
+  To choose a style for the current buffer, use the command @w{@kbd{C-c
+.}}.  Specify a style name as an argument (case is not significant).
 This command affects the current buffer only, and it affects only
 future invocations of the indentation commands; it does not reindent
-the code in the buffer.  To reindent the whole buffer in the new
-style, you can type @kbd{C-x h C-M-\}.
+the code already in the buffer.  To reindent the whole buffer in the
+new style, you can type @kbd{C-x h C-M-\}.
 
 @vindex c-default-style
   You can also set the variable @code{c-default-style} to specify the
@@ -589,23 +601,24 @@ example,
 
 @example
 (setq c-default-style
-      '((java-mode . "java") (other . "gnu")))
+      '((java-mode . "java") (awk-mode . "awk") (other . "gnu")))
 @end example
 
 @noindent
-specifies an explicit choice for Java mode, and the default @samp{gnu}
-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.
+specifies explicit choices for Java and AWK modes, and the default
+@samp{gnu} 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
 recommended style.
 
-  @xref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for
-more information on customizing indentation for C and related modes,
+  @xref{Indentation Engine Basics,,, ccmode, the CC Mode Manual}, and
+@ref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for more
+information on customizing indentation for C and related modes,
 including how to override parts of an existing style and how to define
 your own styles.
 
@@ -708,11 +721,12 @@ would move over.
   A somewhat random-sounding command which is nevertheless handy is
 @kbd{C-M-t} (@code{transpose-sexps}), which drags the previous
 balanced expression across the next one.  An argument serves as a
-repeat count, and a negative argument drags the previous balanced
-expression backwards across those before it (thus canceling out the
-effect of @kbd{C-M-t} with a positive argument).  An argument of zero,
-rather than doing nothing, transposes the balanced expressions ending
-at or after point and the mark.
+repeat count, moving the previous expression over that many following
+ones.  A negative argument drags the previous balanced expression
+backwards across those before it (thus canceling out the effect of
+@kbd{C-M-t} with a positive argument).  An argument of zero, rather
+than doing nothing, transposes the balanced expressions ending at or
+after point and the mark.
 
 @kindex C-M-@@
 @kindex C-M-@key{SPC}
@@ -722,9 +736,9 @@ 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-@@}.  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.
+alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}.  When you
+repeat this command, or use it in Transient Mark mode when the mark is
+active, it extends the end of 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
@@ -775,9 +789,7 @@ parenthetical groupings, skipping blithely over any amount of text
 that doesn't include meaningful parentheses (symbols, strings, etc.).
 
 @kindex C-M-u
-@kindex C-M-d
 @findex backward-up-list
-@findex down-list
   @kbd{C-M-n} and @kbd{C-M-p} try to stay at the same level in the
 parenthesis structure.  To move @emph{up} one (or @var{n}) levels, use
 @kbd{C-M-u} (@code{backward-up-list}).  @kbd{C-M-u} moves backward up
@@ -785,6 +797,8 @@ past one unmatched opening delimiter.  A positive argument serves as a
 repeat count; a negative argument reverses the direction of motion, so
 that the command moves forward and up one or more levels.
 
+@kindex C-M-d
+@findex down-list
   To move @emph{down} in the parenthesis structure, use @kbd{C-M-d}
 (@code{down-list}).  In Lisp mode, where @samp{(} is the only opening
 delimiter, this is nearly the same as searching for a @samp{(}.  An
@@ -836,11 +850,9 @@ highlighted.  (There is no need to highlight the opening delimiter in
 that case, because the cursor appears on top of that character.)  Use
 the command @kbd{M-x show-paren-mode} to enable or disable this mode.
 
-  By default, @code{show-paren-mode} uses colors to highlight the
-parentheses.  However, if your display doesn't support colors, you can
-customize the faces @code{show-paren-match-face} and
-@code{show-paren-mismatch-face} to use other attributes, such as bold or
-underline.  @xref{Face Customization}.
+  Show Paren mode uses the faces @code{show-paren-match} and
+@code{show-paren-mismatch} to highlight parentheses; you can customize
+them to control how highlighting looks.  @xref{Face Customization}.
 
 @node Comments
 @section Manipulating Comments
@@ -852,7 +864,7 @@ also do spell checking on comments with Flyspell Prog mode
 (@pxref{Spelling}).
 
 @menu
-* Comment Commands::    Inserting, killing, and indenting comments.
+* Comment Commands::    Inserting, killing, and aligning comments.
 * Multi-Line Comments:: Commands for adding and editing multi-line comments.
 * Options for Comments::Customizing the comment features.
 @end menu
@@ -860,6 +872,7 @@ also do spell checking on comments with Flyspell Prog mode
 @node Comment Commands
 @subsection Comment Commands
 @cindex indentation for comments
+@cindex alignment for comments
 
   The comment commands in this table insert, kill and align comments.
 They are described in this section and following sections.
@@ -875,7 +888,7 @@ Set comment column (@code{comment-set-column}).
 @item @kbd{C-M-j}
 @itemx @kbd{M-j}
 Like @key{RET} followed by inserting and aligning a comment
-(@code{comment-indent-new-line}).
+(@code{comment-indent-new-line}).  @xref{Multi-Line Comments}.
 @item @kbd{M-x comment-region}
 @itemx @kbd{C-c C-c} (in C-like modes)
 Add or remove comment delimiters on all the lines in the region.
@@ -895,14 +908,14 @@ The new comment begins with the string Emacs thinks comments should
 start with (the value of @code{comment-start}; see below).  Point is
 after that string, so you can insert the text of the comment right
 away.  If the major mode has specified a string to terminate comments,
-@kbd{M-;} inserts that too, to keep the syntax valid.
+@kbd{M-;} inserts that after point, to keep the syntax valid.
 
-  If the text of the line extends past the comment column, then the
-comment start string is indented to a suitable boundary (usually, at
-least one space is inserted).
+  If the text of the line extends past the comment column, this
+command aligns the comment start string to a suitable boundary
+(usually, at least one space is inserted).
 
   You can also use @kbd{M-;} to align an existing comment.  If a line
-already contains the comment-start string, @kbd{M-;} reindents it to
+already contains the comment-start string, @kbd{M-;} realigns it to
 the conventional alignment and moves point after it.  (Exception:
 comments starting in column 0 are not moved.)  Even when an existing
 comment is properly aligned, @kbd{M-;} is still useful for moving
@@ -927,11 +940,12 @@ removes comment delimiters on each line of the region.  (If every line
 is a comment, it removes comment delimiters from each; otherwise, it
 adds comment delimiters to each.)  If you are not using Transient Mark
 mode, then you should use the commands @code{comment-region} and
-@code{uncomment-region} to do these jobs (@pxref{Multi-Line Comments}).
+@code{uncomment-region} to do these jobs (@pxref{Multi-Line Comments}),
+or else enable Transient Mark mode momentarily (@pxref{Momentary Mark}).
 A prefix argument used in these circumstances specifies how many
 comment delimiters to add or how many to delete.
 
-  Some major modes have special rules for indenting certain kinds of
+  Some major modes have special rules for aligning certain kinds of
 comments in certain contexts.  For example, in Lisp code, comments which
 start with two semicolons are indented as if they were lines of code,
 instead of at the comment column.  Comments which start with three
@@ -948,8 +962,13 @@ and by not changing the indentation of a triple-semicolon comment at all.
   (1+ x))           ; This line adds one.
 @end example
 
-  In C code, a comment preceded on its line by nothing but whitespace
-is indented like a line of code.
+  For C-like modes, you can configure the exact effect of @kbd{M-;}
+more flexibly than for most buffers by setting the variables
+@code{c-indent-comment-alist} and
+@code{c-indent-comments-syntactically-p}.  For example, on a line
+ending in a closing brace, @kbd{M-;} puts the comment one space after
+the brace rather than at @code{comment-column}.  For full details see
+@ref{Comment Commands,,, ccmode, The CC Mode Manual}. 
 
 @node Multi-Line Comments
 @subsection Multiple Lines of Comments
@@ -958,32 +977,37 @@ is indented like a line of code.
 @kindex M-j
 @cindex blank lines in programs
 @findex comment-indent-new-line
+
   If you are typing a comment and wish to continue it on another line,
 you can use the command @kbd{C-M-j} or @kbd{M-j}
-(@code{comment-indent-new-line}).  This terminates the comment you are
-typing, creates a new blank line afterward, and begins a new comment
-indented under the old one.  When Auto Fill mode is on, going past the
+(@code{comment-indent-new-line}).  If @code{comment-multi-line}
+(@pxref{Options for Comments}) is non-@code{nil}, it moves to a new
+line within the comment.  Otherwise it closes the comment and starts a
+new comment on a new line.  When Auto Fill mode is on, going past the
 fill column while typing a comment causes the comment to be continued
-in just this fashion.  If point is not at the end of the line when you
-type the command, the text on the rest of the line becomes part of the
-new comment line.
+in just this fashion.
 
 @kindex C-c C-c (C mode)
 @findex comment-region
   To turn existing lines into comment lines, use the @kbd{M-x
-comment-region} command.  It adds comment delimiters to the lines that start
-in the region, thus commenting them out.  With a negative argument, it
-does the opposite---it deletes comment delimiters from the lines in the
-region.
+comment-region} command (or type @kbd{C-c C-c} in C-like modes).  It
+adds comment delimiters to the lines that start in the region, thus
+commenting them out.  With a negative argument, it does the
+opposite---it deletes comment delimiters from the lines in the region.
 
   With a positive argument, @code{comment-region} duplicates the last
-character of the comment start sequence it adds; the argument specifies
-how many copies of the character to insert.  Thus, in Lisp mode,
-@kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line.  Duplicating
-the comment delimiter is a way of calling attention to the comment.  It
-can also affect how the comment is indented.  In Lisp, for proper
-indentation, you should use an argument of two or three, if between defuns;
-if within a defun, it must be three.
+character of the comment start sequence it adds; the argument
+specifies how many copies of the character to insert.  Thus, in Lisp
+mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line.
+Duplicating the comment delimiter is a way of calling attention to the
+comment.  It can also affect how the comment is aligned or indented.
+In Lisp, for proper indentation, you should use an argument of two or
+three, if between defuns; if within a defun, it must be three.
+
+  You can configure C Mode such that when you type a @samp{/} at the
+start of a line in a multi-line block comment, this closes the
+comment.  Enable the @code{comment-close-slash} clean-up for this.
+@xref{Clean-ups,,, ccmode, The CC Mode Manual}.
 
 @node Options for Comments
 @subsection Options Controlling Comments
@@ -1016,15 +1040,17 @@ 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
   When a comment command makes a new comment, it inserts the value of
 @code{comment-start} to begin it.  The value of @code{comment-end} is
-inserted after point, so that it will follow the text that you will insert
-into the comment.  In C mode, @code{comment-start} has the value
-@w{@code{"/* "}} and @code{comment-end} has the value @w{@code{" */"}}.
+inserted after point, so that it will follow the text that you will
+insert into the comment.  When @code{comment-end} is non-empty, it
+should start with a space.  For example, in C mode,
+@code{comment-start} has the value @w{@code{"/* "}} and
+@code{comment-end} has the value @w{@code{" */"}}.
 
 @vindex comment-padding
   The variable @code{comment-padding} specifies how many spaces
@@ -1036,17 +1062,17 @@ can hold the actual string to insert.
 @vindex comment-multi-line
   The variable @code{comment-multi-line} controls how @kbd{C-M-j}
 (@code{indent-new-comment-line}) behaves when used inside a comment.
-Specifically, when @code{comment-multi-line} is @code{nil} (the
-default value), the command inserts a comment terminator, begins a new
-line, and finally inserts a comment starter.  Otherwise it does not
-insert the terminator and starter, so it effectively continues the
-current comment across multiple lines.  In languages that allow
-multi-line comments, the choice of value for this variable is a matter
-of taste.
+Specifically, when @code{comment-multi-line} is @code{nil}the
+command inserts a comment terminator, begins a new line, and finally
+inserts a comment starter.  Otherwise it does not insert the
+terminator and starter, so it effectively continues the current
+comment across multiple lines.  In languages that allow multi-line
+comments, the choice of value for this variable is a matter of taste.
+The default for this variable depends on the major mode.
 
 @vindex comment-indent-function
   The variable @code{comment-indent-function} should contain a function
-that will be called to compute the indentation for a newly inserted
+that will be called to compute the alignment for a newly inserted
 comment or for aligning an existing comment.  It is set differently by
 various major modes.  The function is called with no arguments, but with
 point at the beginning of the comment, or at the end of a line if a new
@@ -1075,29 +1101,31 @@ use in your program.
 @findex info-lookup-symbol
 @findex info-lookup-file
 @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 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.
+  For many major modes, that apply to 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 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 command only works if the appropriate manual's
+Info files are installed.
 
   The major mode determines where to look for documentation for the
 symbol---which Info files to look in, and which indices to search.
 You can also use @kbd{M-x info-lookup-file} to look for documentation
 for a file name.
 
-  This feature currently supports the modes AWK, Autoconf, Bison, C,
-Emacs Lisp, LaTeX, M4, Makefile, Octave, Perl, Scheme, and Texinfo,
-provided you have installed the relevant Info files, which are
-typically available with the appropriate GNU package.
+  If you use @kbd{C-h S} in a major mode that does not support it,
+it asks you to specify the ``symbol help mode''.  You should enter
+a command such as @code{c-mode} that would select a major
+mode which @kbd{C-h S} does support.
 
 @node Man Page
 @subsection Man Page Lookup
 
 @cindex manual page
   On Unix, the main form of on-line documentation was the @dfn{manual
-page} or @dfn{man page}.  In the GNU operating system, we hope to
+page} or @dfn{man page}.  In the GNU operating system, we aim to
 replace man pages with better-organized manuals that you can browse
 with Info (@pxref{Misc Help}).  This process is not finished, so it is
 still useful to read manual pages.
@@ -1123,8 +1151,8 @@ a man page from a specific section, type
 when @kbd{M-x manual-entry} prompts for the topic.  For example, to
 read the man page for the C library function @code{chmod} (as opposed
 to a command of the same name), type @kbd{M-x manual-entry @key{RET}
-chmod(2) @key{RET}} (@code{chmod} is a system call, so it is in
-section @samp{2}).
+chmod(2) @key{RET}} (@code{chmod} is a system call, so it is in
+section @samp{2}.)
 
 @vindex Man-switches
   If you do not specify a section, the results depend on how the
@@ -1175,42 +1203,6 @@ several manual pages by the same name exist in different sections, it
 pops up a window with possible candidates asking you to choose one of
 them.
 
-@vindex woman-manpath
-  By default, @kbd{M-x woman} looks for manual pages in the
-directories specified in the @code{MANPATH} environment variable.  (If
-@code{MANPATH} is not set, @code{woman} uses a suitable default value,
-which can be customized.)  More precisely, @code{woman} looks for
-subdirectories that match the shell wildcard pattern @file{man*} in each one
-of these directories, and tries to find the manual pages in those
-subdirectories.  When first invoked, @kbd{M-x woman} converts the
-value of @code{MANPATH} to a list of directory names and stores that
-list in the @code{woman-manpath} variable.  Changing the value of this
-variable is another way to control the list of directories used.
-
-@vindex woman-path
-  You can also augment the list of directories searched by
-@code{woman} by setting the value of the @code{woman-path} variable.
-This variable should hold a list of specific directories which
-@code{woman} should search, in addition to those in
-@code{woman-manpath}.  Unlike @code{woman-manpath}, the directories in
-@code{woman-path} are searched for the manual pages, not for
-@file{man*} subdirectories.
-
-@findex woman-find-file
-  Occasionally, you might need to display manual pages that are not in
-any of the directories listed by @code{woman-manpath} and
-@code{woman-path}.  The @kbd{M-x woman-find-file} command prompts for a
-name of a manual page file, with completion, and then formats and
-displays that file like @kbd{M-x woman} does.
-
-@vindex woman-dired-keys
-  The first time you invoke @kbd{M-x woman}, it defines the Dired
-@kbd{W} key to run the @code{woman-find-file} command on the current
-line's file.  You can disable this by setting the variable
-@code{woman-dired-keys} to @code{nil}.  @xref{Dired}.  In addition,
-the Tar-mode @kbd{w} key is define to invoke @code{woman-find-file} on
-the current line's archive member.
-
   For more information about setting up and using @kbd{M-x woman}, see
 @ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The WoMan
 Manual}.
@@ -1235,9 +1227,10 @@ 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.)  If point is over a documented variable, it
-shows the variable's docstring.  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.
+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
@@ -1296,8 +1289,8 @@ Hide all blocks @var{n} levels below this block
 Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too.
 
 @item hs-isearch-open
-Specifies what kind of hidden blocks to open in Isearch mode.
-The value should be one of these four symbols:
+Specifies what kind of hidden blocks incremental search should make
+visible.  The value should be one of these four symbols:
 
 @table @code
 @item code
@@ -1504,176 +1497,96 @@ moves by sentences instead of statements.
 Move point to the end of the innermost C statement or sentence; like
 @kbd{M-a} except that it moves in the other direction
 (@code{c-end-of-statement}).
-
-@item M-x c-backward-into-nomenclature
-@findex c-backward-into-nomenclature
-Move point backward to beginning of a C++ nomenclature section or word.
-With prefix argument @var{n}, move @var{n} times.  If @var{n} is
-negative, move forward.  C++ nomenclature means a symbol name in the
-style of NamingSymbolsWithMixedCaseAndNoUnderlines; each capital letter
-begins a section or word.
-
-In the GNU project, we recommend using underscores to separate words
-within an identifier in C or C++, rather than using case distinctions.
-
-@item M-x c-forward-into-nomenclature
-@findex c-forward-into-nomenclature
-Move point forward to end of a C++ nomenclature section or word.
-With prefix argument @var{n}, move @var{n} times.
 @end table
 
 @node Electric C
 @subsection Electric C Characters
 
   In C mode and related modes, certain printing characters are
-``electric''---in addition to inserting themselves, they also reindent
-the current line, and optionally also insert newlines.  The
+@dfn{electric}---in addition to inserting themselves, they also
+reindent 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
-mode name).  This feature is controlled by the variable
-@code{c-auto-newline}.  You can turn this feature on or off with the
-command @kbd{C-c C-a}:
+  You might find electric indentation inconvenient if you are editing
+chaotically indented code.  If you are new to CC Mode, you might find
+it disconcerting.  You can toggle electric action with the command
+@kbd{C-c C-l}; when it is enabled, @samp{/l} appears in the mode line
+after the mode name:
 
 @table @kbd
-@item C-c C-a
-@kindex C-c C-a @r{(C mode)}
-@findex c-toggle-auto-state
-Toggle the auto-newline feature (@code{c-toggle-auto-state}).  With a
-prefix argument, this command turns the auto-newline feature on if the
-argument is positive, and off if it is negative.
+@item C-c C-l
+@kindex C-c C-l @r{(C mode)}
+@findex c-toggle-electric-state
+Toggle electric action (@code{c-toggle-electric-state}).  With a
+prefix argument, this command enables electric action if the argument
+is positive, disables it if it is negative.
 @end table
 
-  The colon character is electric because that is appropriate for a
-single colon.  But when you want to insert a double colon in C++, the
-electric behavior of colon is inconvenient.  You can insert a double
-colon with no reindentation or newlines by typing @kbd{C-c :}:
+  Electric characters insert newlines only when, in addition to the
+electric state, the @dfn{auto-newline} feature is enabled (indicated
+by @samp{/la} in the mode line after the mode name).  You can turn
+this feature on or off with the command @kbd{C-c C-a}:
 
 @table @kbd
-@item C-c :
-@ifinfo
-@c This uses ``colon'' instead of a literal `:' because Info cannot
-@c cope with a `:' in a menu
-@kindex C-c @key{colon} @r{(C mode)}
-@end ifinfo
-@ifnotinfo
-@kindex C-c : @r{(C mode)}
-@end ifnotinfo
-@findex c-scope-operator
-Insert a double colon scope operator at point, without reindenting the
-line or adding any newlines (@code{c-scope-operator}).
+@item C-c C-a
+@kindex C-c C-a @r{(C mode)}
+@findex c-toggle-auto-newline
+Toggle the auto-newline feature (@code{c-toggle-auto-newline}).  With a
+prefix argument, this command turns the auto-newline feature on if the
+argument is positive, and off if it is negative.
 @end table
 
-@vindex c-electric-pound-behavior
-  The electric @kbd{#} key reindents the line if it appears to be the
-beginning of a preprocessor directive.  This happens when the value of
-@code{c-electric-pound-behavior} is @code{(alignleft)}.  You can turn
-this feature off by setting @code{c-electric-pound-behavior} to
-@code{nil}.
-
-@vindex c-hanging-braces-alist
-   The variable @code{c-hanging-braces-alist} controls the insertion of
-newlines before and after inserted braces.  It is an association list
-with elements of the following form: @code{(@var{syntactic-symbol}
-. @var{nl-list})}.  Most of the syntactic symbols that appear in
-@code{c-offsets-alist} are meaningful here as well.
-
-   The list @var{nl-list} may contain either of the symbols
-@code{before} or @code{after}, or both; or it may be @code{nil}.  When a
-brace is inserted, the syntactic context it defines is looked up in
-@code{c-hanging-braces-alist}; if it is found, the @var{nl-list} is used
-to determine where newlines are inserted: either before the brace,
-after, or both.  If not found, the default is to insert a newline both
-before and after braces.
-
-@vindex c-hanging-colons-alist
-   The variable @code{c-hanging-colons-alist} controls the insertion of
-newlines before and after inserted colons.  It is an association list
-with elements of the following form: @code{(@var{syntactic-symbol}
-. @var{nl-list})}.  The list @var{nl-list} may contain either of the
-symbols @code{before} or @code{after}, or both; or it may be @code{nil}.
-
-   When a colon is inserted, the syntactic symbol it defines is looked
-up in this list, and if found, the @var{nl-list} is used to determine
-where newlines are inserted: either before the brace, after, or both.
-If the syntactic symbol is not found in this list, no newlines are
-inserted.
-
-@vindex c-cleanup-list
-   Electric characters can also delete newlines automatically when the
-auto-newline feature is enabled.  This feature makes auto-newline more
-acceptable, by deleting the newlines in the most common cases where you
-do not want them.  Emacs can recognize several cases in which deleting a
-newline might be desirable; by setting the variable
-@code{c-cleanup-list}, you can specify @emph{which} of these cases that
-should happen.  The variable's value is a list of symbols, each
-describing one case for possible deletion of a newline.  Here are the
-meaningful symbols, and their meanings:
-
-@table @code
-@item brace-catch-brace
-Clean up @samp{@} catch (@var{condition}) @{} constructs by placing the
-entire construct on a single line.  The clean-up occurs when you type
-the @samp{@{}, if there is nothing between the braces aside from
-@code{catch} and @var{condition}.
-
-@item brace-else-brace
-Clean up @samp{@} else @{} constructs by placing the entire construct on
-a single line.  The clean-up occurs when you type the @samp{@{} after
-the @code{else}, but only if there is nothing but white space between
-the braces and the @code{else}.
-
-@item brace-elseif-brace
-Clean up @samp{@} else if (@dots{}) @{} constructs by placing the entire
-construct on a single line.  The clean-up occurs when you type the
-@samp{@{}, if there is nothing but white space between the @samp{@}} and
-@samp{@{} aside from the keywords and the @code{if}-condition.
-
-@item empty-defun-braces
-Clean up empty defun braces by placing the braces on the same
-line.  Clean-up occurs when you type the closing brace.
-
-@item defun-close-semi
-Clean up the semicolon after a @code{struct} or similar type
-declaration, by placing the semicolon on the same line as the closing
-brace.  Clean-up occurs when you type the semicolon.
-
-@item list-close-comma
-Clean up commas following braces in array and aggregate
-initializers.  Clean-up occurs when you type the comma.
-
-@item scope-operator
-Clean up double colons which may designate a C++ scope operator, by
-placing the colons together.  Clean-up occurs when you type the second
-colon, but only when the two colons are separated by nothing but
-whitespace.
-@end table
+  Usually the CC Mode style configures the exact circumstances in
+which Emacs inserts auto-newlines.  You can also configure this
+directly.  @xref{Custom Auto-newlines,,, ccmode, The CC Mode Manual}.
 
 @node Hungry Delete
 @subsection Hungry Delete Feature in C
 @cindex hungry deletion (C Mode)
 
-  When the @dfn{hungry-delete} feature is enabled (indicated by
-@samp{/h} or @samp{/ah} in the mode line after the mode name), a single
-@key{DEL} command deletes all preceding whitespace, not just one space.
-To turn this feature on or off, use @kbd{C-c C-d}:
+  If you want to delete an entire block of whitespace at point, you
+can use @dfn{hungry deletion}.  This deletes all the contiguous
+whitespace either before point or after point in a single operation.
+@dfn{Whitespace} here includes tabs and newlines, but not comments or
+preprocessor commands.
 
 @table @kbd
+@item C-c C-@key{DEL}
+@itemx C-c @key{DEL}
+@findex c-hungry-backspace
+@kindex C-c C-@key{DEL} (C Mode)
+@kindex C-c @key{DEL} (C Mode)
+@code{c-hungry-backspace}---Delete the entire block of whitespace
+preceding point.
+
 @item C-c C-d
-@kindex C-c C-d @r{(C mode)}
-@findex c-toggle-hungry-state
-Toggle the hungry-delete feature (@code{c-toggle-hungry-state}).  With a
-prefix argument, this command turns the hungry-delete feature on if the
-argument is positive, and off if it is negative.
+@itemx C-c C-@key{DELETE}
+@itemx C-c @key{DELETE}
+@findex c-hungry-delete-forward
+@kindex C-c C-d (C Mode)
+@kindex C-c C-@key{DELETE} (C Mode)
+@kindex C-c @key{DELETE} (C Mode)
+@code{c-hungry-delete-forward}---Delete the entire block of whitespace
+following point.
+@end table
+
+  As an alternative to the above commands, you can enable @dfn{hungry
+delete mode}.  When this feature is enabled (indicated by @samp{/h} in
+the mode line after the mode name), a single @key{DEL} deletes all
+preceding whitespace, not just one space, and a single @kbd{C-c C-d}
+(but @emph{not} plain @key{DELETE}) deletes all following whitespace.
 
-@item C-c C-t
-@kindex C-c C-t @r{(C mode)}
-@findex c-toggle-auto-hungry-state
-Toggle the auto-newline and hungry-delete features, both at once
-(@code{c-toggle-auto-hungry-state}).
+@table @kbd
+@item M-x c-toggle-hungry-state
+@findex c-toggle-hungry-state
+Toggle the hungry-delete feature
+(@code{c-toggle-hungry-state})@footnote{This command had the binding
+@kbd{C-c C-d} in earlier versions of Emacs.  @kbd{C-c C-d} is now
+bound to @code{c-hungry-delete-forward}.}.  With a prefix argument,
+this command turns the hungry-delete feature on if the argument is
+positive, and off if it is negative.
 @end table
 
 @vindex c-hungry-delete-key
@@ -1684,6 +1597,19 @@ hungry-delete feature is enabled.
 @subsection Other Commands for C Mode
 
 @table @kbd
+@item C-c C-w
+@itemx M-x c-subword-mode
+@findex c-subword-mode
+Enable (or disable) @dfn{subword mode}.  In subword mode, Emacs's word
+commands then recognize upper case letters in
+@samp{StudlyCapsIdentifiers} as word boundaries.  This is indicated by
+the flag @samp{/w} on the mode line after the mode name
+(e.g. @samp{C/law}).  You can even use @kbd{M-x c-subword-mode} in
+non-CC Mode buffers.
+
+In the GNU project, we recommend using underscores to separate words
+within an identifier in C or C++, rather than using case distinctions.
+
 @item M-x c-context-line-break
 @findex c-context-line-break
 This command inserts a line break and indents the new line in a manner
@@ -1694,9 +1620,13 @@ it's like @kbd{M-j} (@code{c-indent-new-comment-line}).
 
 @code{c-context-line-break} isn't bound to a key by default, but it
 needs a binding to be useful.  The following code will bind it to
-@kbd{C-j}.
+@kbd{C-j}.  We use @code{c-initialization-hook} here to make sure
+the keymap is loaded before we try to change it.
+
 @example
-(define-key c-mode-base-map "\C-j" 'c-context-line-break)
+(defun my-bind-clb ()
+  (define-key c-mode-base-map "\C-j" 'c-context-line-break))
+(add-hook 'c-initialization-hook 'my-bind-clb)
 @end example
 
 @item C-M-h
@@ -1799,518 +1729,6 @@ to a C/C++ source file, or vice versa.  The variable
 names.
 @end table
 
-@node Fortran
-@section Fortran Mode
-@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 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
-typing when you insert Fortran keywords.
-
-  Use @kbd{M-x fortran-mode} to switch to this major mode.  This command
-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'' (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 support for Fortran.
-* Columns: Fortran Columns.     Measuring columns for valid Fortran.
-* Abbrev: Fortran Abbrev.       Built-in abbrevs for Fortran keywords.
-@end menu
-
-@node Fortran Motion
-@subsection Motion Commands
-
-  In addition to the normal commands for moving by and operating on
-``defuns'' (Fortran subprograms---functions and subroutines, as well as
-modules for F90 mode), Fortran mode provides special commands to move by
-statements.
-
-@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 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 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{(F90 mode)}
-@findex f90-end-of-block
-@item C-M-n
-Move to the end of the current code block (@code{f90-end-of-block}).
-This is for F90 mode only.  With a numeric agument, move forward that
-number of blocks.  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.  The mark is set before moving point.
-
-@kindex C-M-p @r{(F90 mode)}
-@findex f90-beginning-of-block
-@item C-M-p
-Move to the start of the current code block
-(@code{f90-beginning-of-block}). This is like @code{f90-end-of-block},
-but moves backwards.
-@end table
-
-@node Fortran Indent
-@subsection Fortran Indentation
-
-  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, fixed (or tab) format Fortran.
-
-@menu
-* Commands: ForIndent Commands.  Commands for indenting and filling Fortran.
-* Contline: ForIndent Cont.      How continuation lines indent.
-* Numbers:  ForIndent Num.       How line numbers auto-indent.
-* Conv:     ForIndent Conv.      Conventions you must obey to avoid trouble.
-* Vars:     ForIndent Vars.      Variables controlling Fortran indent style.
-@end menu
-
-@node ForIndent Commands
-@subsubsection Fortran Indentation and Filling Commands
-
-@table @kbd
-@item C-M-j
-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}).
-@item C-M-q
-Indent all the lines of the subprogram point is in
-(@code{fortran-indent-subprogram}).
-@item M-q
-Fill a comment block or statement.
-@end table
-
-@kindex C-M-q @r{(Fortran mode)}
-@findex fortran-indent-subprogram
-  The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
-to reindent all the lines of the Fortran subprogram (function or
-subroutine) containing point.
-
-@kindex C-M-j @r{(Fortran mode)}
-@findex fortran-split-line
-  The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
-a line in the appropriate fashion for Fortran.  In a non-comment line,
-the second half becomes a continuation line and is indented
-accordingly.  In a comment line, both halves become separate comment
-lines.
-
-@kindex M-^ @r{(Fortran mode)}
-@kindex C-c C-d @r{(Fortran mode)}
-@findex fortran-join-line
-  @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
-which joins a continuation line back to the previous line, roughly as
-the inverse of @code{fortran-split-line}.  The point must be on a
-continuation line when this command is invoked.
-
-@kindex M-q @r{(Fortran mode)}
-@kbd{M-q} in Fortran mode fills the comment block or statement that
-point is in.  This removes any excess statement continuations.
-
-@node ForIndent Cont
-@subsubsection Continuation Lines
-@cindex Fortran continuation lines
-
-@vindex fortran-continuation-string
-  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)}
-@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
-number for the body of a statement is 6.  Lines inside of Fortran
-blocks that are indented to larger column numbers always use only the
-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.
-
-@node ForIndent Num
-@subsubsection Line Numbers
-
-  If a number is the first non-whitespace in the line, Fortran
-indentation assumes it is a line number and moves it to columns 0
-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.  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}.  
-
-
-@node ForIndent Conv
-@subsubsection Syntactic Conventions
-
-  Fortran mode assumes that you follow certain conventions that simplify
-the task of understanding a Fortran program well enough to indent it
-properly:
-
-@itemize @bullet
-@item
-Two nested @samp{do} loops never share a @samp{continue} statement.
-
-@item
-Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
-and others are written without embedded whitespace or line breaks.
-
-Fortran compilers generally ignore whitespace outside of string
-constants, but Fortran mode does not recognize these keywords if they
-are not contiguous.  Constructs such as @samp{else if} or @samp{end do}
-are acceptable, but the second word should be on the same line as the
-first and not on a continuation line.
-@end itemize
-
-@noindent
-If you fail to follow these conventions, the indentation commands may
-indent some lines unaesthetically.  However, a correct Fortran program
-retains its meaning when reindented even if the conventions are not
-followed.
-
-@node ForIndent Vars
-@subsubsection Variables for Fortran Indentation
-
-@vindex fortran-do-indent
-@vindex fortran-if-indent
-@vindex fortran-structure-indent
-@vindex fortran-continuation-indent
-@vindex fortran-check-all-num@dots{}
-@vindex fortran-minimum-statement-indent@dots{}
-  Several additional variables control how Fortran indentation works:
-
-@table @code
-@item fortran-do-indent
-Extra indentation within each level of @samp{do} statement (default 3).
-
-@item fortran-if-indent
-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},
-@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
-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} (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
-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
-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 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{fortran-comment-line-start} to @samp{"!"}.
-
-@table @kbd
-@item M-;
-Align comment or insert new comment (@code{fortran-indent-comment}).
-
-@item C-x ;
-Applies to nonstandard @samp{!} comments only.
-
-@item C-c ;
-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-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
-other modes.
-
-  When a new comment must be inserted, if the current line is blank, a
-full-line comment is inserted.  On a non-blank line, a nonstandard @samp{!}
-comment is inserted if you have said you want to use them.  Otherwise a
-full-line comment is inserted on a new line before the current line.
-
-  Nonstandard @samp{!} comments are aligned like comments in other
-languages, but full-line comments are different.  In a standard full-line
-comment, the comment delimiter itself must always appear in column zero.
-What can be aligned is the text within the comment.  You can choose from
-three styles of alignment by setting the variable
-@code{fortran-comment-indent-style} to one of these values:
-
-@vindex fortran-comment-indent-style
-@vindex fortran-comment-line-extra-indent
-@table @code
-@item fixed
-Align the text at a fixed column, which is the sum of
-@code{fortran-comment-line-extra-indent} and the minimum statement
-indentation.  This is the default.
-
-The minimum statement indentation is
-@code{fortran-minimum-statement-indent-fixed} for fixed format
-continuation line style and @code{fortran-minimum-statement-indent-tab}
-for tab format style.
-
-@item relative
-Align the text as if it were a line of code, but with an additional
-@code{fortran-comment-line-extra-indent} columns of indentation.
-
-@item nil
-Don't move text in full-line comments automatically.
-@end table
-
-@vindex fortran-comment-indent-char
-  In addition, you can specify the character to be used to indent within
-full-line comments by setting the variable
-@code{fortran-comment-indent-char} to the single-character string you want
-to use.
-
-@vindex fortran-directive-re
-  Compiler directive lines, or preprocessor lines, have much the same
-appearance as comment lines.  It is important, though, that such lines
-never be indented at all, no matter what the value of
-@code{fortran-comment-indent-style}.  The variable
-@code{fortran-directive-re} is a regular expression that specifies which
-lines are directives.  Matching lines are never indented, and receive
-distinctive font-locking.
-
-  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.
-
-@kindex C-c ; @r{(Fortran mode)}
-@findex fortran-comment-region
-@vindex fortran-comment-region
-  The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
-lines of the region into comments by inserting the string @samp{C$$$} at
-the front of each one.  With a numeric argument, it turns the region
-back into live code by deleting @samp{C$$$} from the front of each line
-in it.  The string used for these comments can be controlled by setting
-the variable @code{fortran-comment-region}.  Note that here we have an
-example of a command and a variable with the same name; these two uses
-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 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
-   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
-
-@table @kbd
-@item C-c C-r
-Display a ``column ruler'' momentarily above the current line
-(@code{fortran-column-ruler}).
-@item C-c C-w
-Split the current window horizontally temporarily so that it is 72
-columns wide (@code{fortran-window-create-momentarily}).  This may
-help you avoid making lines longer than the 72-character limit that
-some Fortran compilers impose.
-@item C-u C-c C-w
-Split the current window horizontally so that it is 72 columns wide
-(@code{fortran-window-create}).  You can then continue editing.
-@item M-x fortran-strip-sequence-nos
-Delete all text in column 72 and beyond.
-@end table
-
-@kindex C-c C-r @r{(Fortran mode)}
-@findex fortran-column-ruler
-  The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
-ruler momentarily above the current line.  The comment ruler is two lines
-of text that show you the locations of columns with special significance in
-Fortran programs.  Square brackets show the limits of the columns for line
-numbers, and curly brackets show the limits of the columns for the
-statement body.  Column numbers appear above them.
-
-  Note that the column numbers count from zero, as always in GNU Emacs.
-As a result, the numbers may be one less than those you are familiar
-with; but the positions they indicate in the line are standard for
-Fortran.
-
-@vindex fortran-column-ruler-fixed
-@vindex fortran-column-ruler-tabs
-  The text used to display the column ruler depends on the value of the
-variable @code{indent-tabs-mode}.  If @code{indent-tabs-mode} is
-@code{nil}, then the value of the variable
-@code{fortran-column-ruler-fixed} is used as the column ruler.
-Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
-displayed.  By changing these variables, you can change the column ruler
-display.
-
-@kindex C-c C-w @r{(Fortran mode)}
-@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 any lines that are too long.  Type a space to
-restore the normal width.
-
-@kindex C-u C-c C-w @r{(Fortran mode)}
-@findex fortran-window-create
-  You can also split the window horizontally and continue editing with
-the split in place.  To do this, use @kbd{C-u C-c C-w} (@code{M-x
-fortran-window-create}).  By editing in this window you can
-immediately see when you make a line too wide to be correct Fortran.
-
-@findex fortran-strip-sequence-nos
-  The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
-column 72 and beyond, on all lines in the current buffer.  This is the
-easiest way to get rid of old sequence numbers.
-
-@node Fortran Abbrev
-@subsection Fortran Keyword Abbrevs
-
-  Fortran mode provides many built-in abbrevs for common keywords and
-declarations.  These are the same sort of abbrev that you can define
-yourself.  To use them, you must turn on Abbrev mode.  @xref{Abbrevs}.
-
-  The built-in abbrevs are unusual in one way: they all start with a
-semicolon.  You cannot normally use semicolon in an abbrev, but Fortran
-mode makes this possible by changing the syntax of semicolon to ``word
-constituent.''
-
-  For example, one built-in Fortran abbrev is @samp{;c} for
-@samp{continue}.  If you insert @samp{;c} and then insert a punctuation
-character such as a space or a newline, the @samp{;c} expands automatically
-to @samp{continue}, provided Abbrev mode is enabled.@refill
-
-  Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
-Fortran abbrevs and what they stand for.
-
 @node Asm Mode
 @section Asm Mode
 
@@ -2334,6 +1752,10 @@ Insert or align a comment.
   The variable @code{asm-comment-char} specifies which character
 starts comments in assembler syntax.
 
+@ifnottex
+@include fortran-xtra.texi
+@end ifnottex
+
 @ignore
    arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0
 @end ignore