aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2005-03-27 17:16:31 +0000
committerGlenn Morris2005-03-27 17:16:31 +0000
commit40279251d4832bd4424e8b6acc04bfa6bd92b1fd (patch)
tree76400befeae8026f0b51ad78de9823ffacb4d7e0
parent91878d2b21e8aeef079d043d2617bf21ea3d0d9c (diff)
downloademacs-40279251d4832bd4424e8b6acc04bfa6bd92b1fd.tar.gz
emacs-40279251d4832bd4424e8b6acc04bfa6bd92b1fd.zip
Reformat and update copyright years.
(Fortran): Update section.
-rw-r--r--man/programs.texi207
1 files changed, 102 insertions, 105 deletions
diff --git a/man/programs.texi b/man/programs.texi
index 353cb85aa60..6855d57d327 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -1,5 +1,6 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985,86,87,93,94,95,97,99,00,2001 Free Software Foundation, Inc. 2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
3@c 2001, 2005 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
4@node Programs, Building, Text, Top 5@node Programs, Building, Text, Top
5@chapter Editing Programs 6@chapter Editing Programs
@@ -1801,11 +1802,11 @@ names.
1801@cindex Fortran mode 1802@cindex Fortran mode
1802@cindex mode, Fortran 1803@cindex mode, Fortran
1803 1804
1804 Fortran mode provides special motion commands for Fortran statements and 1805 Fortran mode provides special motion commands for Fortran statements
1805subprograms, and indentation commands that understand Fortran conventions 1806and subprograms, and indentation commands that understand Fortran
1806of nesting, line numbers and continuation statements. Fortran mode has 1807conventions of nesting, line numbers and continuation statements.
1807its own Auto Fill mode that breaks long lines into proper Fortran 1808Fortran mode has support for Auto Fill mode that breaks long lines into
1808continuation lines. 1809proper Fortran continuation lines.
1809 1810
1810 Special commands for comments are provided because Fortran comments 1811 Special commands for comments are provided because Fortran comments
1811are unlike those of other languages. Built-in abbrevs optionally save 1812are unlike those of other languages. Built-in abbrevs optionally save
@@ -1817,18 +1818,18 @@ runs the hook @code{fortran-mode-hook} (@pxref{Hooks}).
1817@cindex Fortran77 and Fortran90 1818@cindex Fortran77 and Fortran90
1818@findex f90-mode 1819@findex f90-mode
1819@findex fortran-mode 1820@findex fortran-mode
1820 Fortran mode is meant for editing Fortran77 ``fixed format'' source 1821 Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
1821code. For editing the modern Fortran90 ``free format'' source code, 1822``tab format'') source code. For editing the modern Fortran90 or
1822use F90 mode (@code{f90-mode}). Emacs normally uses Fortran mode for 1823Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
1823files with extension @samp{.f}, @samp{.F} or @samp{.for}, and F90 mode 1824Emacs normally uses Fortran mode for files with extension @samp{.f},
1824for the extension @samp{.f90}. GNU Fortran supports both kinds of 1825@samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
1825format. 1826@samp{.f95}. GNU Fortran supports both kinds of format.
1826 1827
1827@menu 1828@menu
1828* Motion: Fortran Motion. Moving point by statements or subprograms. 1829* Motion: Fortran Motion. Moving point by statements or subprograms.
1829* Indent: Fortran Indent. Indentation commands for Fortran. 1830* Indent: Fortran Indent. Indentation commands for Fortran.
1830* Comments: Fortran Comments. Inserting and aligning comments. 1831* Comments: Fortran Comments. Inserting and aligning comments.
1831* Autofill: Fortran Autofill. Auto fill minor mode for Fortran. 1832* Autofill: Fortran Autofill. Auto fill support for Fortran.
1832* Columns: Fortran Columns. Measuring columns for valid Fortran. 1833* Columns: Fortran Columns. Measuring columns for valid Fortran.
1833* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. 1834* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
1834@end menu 1835@end menu
@@ -1837,8 +1838,9 @@ format.
1837@subsection Motion Commands 1838@subsection Motion Commands
1838 1839
1839 In addition to the normal commands for moving by and operating on 1840 In addition to the normal commands for moving by and operating on
1840``defuns'' (Fortran subprograms---functions and subroutines), Fortran 1841``defuns'' (Fortran subprograms---functions and subroutines, as well as
1841mode provides special commands to move by statements. 1842modules for F90 mode), Fortran mode provides special commands to move by
1843statements.
1842 1844
1843@table @kbd 1845@table @kbd
1844@kindex C-c C-n @r{(Fortran mode)} 1846@kindex C-c C-n @r{(Fortran mode)}
@@ -1896,7 +1898,7 @@ but moves backwards.
1896 Special commands and features are needed for indenting Fortran code in 1898 Special commands and features are needed for indenting Fortran code in
1897order to make sure various syntactic entities (line numbers, comment line 1899order to make sure various syntactic entities (line numbers, comment line
1898indicators and continuation line flags) appear in the columns that are 1900indicators and continuation line flags) appear in the columns that are
1899required for standard Fortran. 1901required for standard, fixed (or tab) format Fortran.
1900 1902
1901@menu 1903@menu
1902* Commands: ForIndent Commands. Commands for indenting and filling Fortran. 1904* Commands: ForIndent Commands. Commands for indenting and filling Fortran.
@@ -1911,7 +1913,7 @@ required for standard Fortran.
1911 1913
1912@table @kbd 1914@table @kbd
1913@item C-M-j 1915@item C-M-j
1914Break the current line and set up a continuation line 1916Break the current line at point and set up a continuation line
1915(@code{fortran-split-line}). 1917(@code{fortran-split-line}).
1916@item M-^ 1918@item M-^
1917Join this line to the previous line (@code{fortran-join-line}). 1919Join this line to the previous line (@code{fortran-join-line}).
@@ -1953,30 +1955,42 @@ point is in. This removes any excess statement continuations.
1953@cindex Fortran continuation lines 1955@cindex Fortran continuation lines
1954 1956
1955@vindex fortran-continuation-string 1957@vindex fortran-continuation-string
1956 Most modern Fortran compilers allow two ways of writing continuation 1958 Most Fortran77 compilers allow two ways of writing continuation lines.
1957lines. If the first non-space character on a line is in column 5, then 1959If the first non-space character on a line is in column 5, then that
1958that line is a continuation of the previous line. We call this 1960line is a continuation of the previous line. We call this @dfn{fixed
1959@dfn{fixed format}. (In GNU Emacs we always count columns from 0.) The 1961format}. (In GNU Emacs we always count columns from 0; but note that
1960variable @code{fortran-continuation-string} specifies what character to 1962the Fortran standard counts from 1.) The variable
1961put on column 5. A line that starts with a tab character followed by 1963@code{fortran-continuation-string} specifies what character to put in
1962any digit except @samp{0} is also a continuation line. We call this 1964column 5. A line that starts with a tab character followed by any digit
1963style of continuation @dfn{tab format}. 1965except @samp{0} is also a continuation line. We call this style of
1966continuation @dfn{tab format}. (Fortran90 introduced ``free format'',
1967with another style of continuation lines).
1964 1968
1965@vindex indent-tabs-mode @r{(Fortran mode)} 1969@vindex indent-tabs-mode @r{(Fortran mode)}
1966 Fortran mode can make either style of continuation line, but you 1970@vindex fortran-analyze-depth
1967must specify which one you prefer. The value of the variable 1971@vindex fortran-tab-mode-default
1968@code{indent-tabs-mode} controls the choice: @code{nil} for fixed 1972@vindex fortran-tab-mode-string
1969format, and non-@code{nil} for tab format. You can tell which style 1973 Fortran mode can use either style of continuation line. When you
1970is presently in effect by the presence or absence of the string 1974enter Fortran mode, it tries to deduce the proper continuation style
1971@samp{Tab} in the mode line. 1975automatically from the buffer contents. It does this by scanning up to
1972 1976@code{fortran-analyze-depth} (default 100) lines from the start of the
1973 If the text on a line starts with the conventional Fortran 1977buffer. The first line that begins with either a tab character or six
1974continuation marker @samp{$}, or if it begins with any non-whitespace 1978spaces determines the choice. If the scan fails (for example, if the
1975character in column 5, Fortran mode treats it as a continuation line. 1979buffer is new and therefore empty), the value of
1976When you indent a continuation line with @key{TAB}, it converts the line 1980@code{fortran-tab-mode-default} (@code{nil} for fixed format, and
1977to the current continuation style. When you split a Fortran statement 1981non-@code{nil} for tab format) is used. You can tell which style is
1978with @kbd{C-M-j}, the continuation marker on the newline is created 1982presently in effect by the presence or absence of the string specified
1979according to the continuation style. 1983by @code{fortran-tab-mode-string} (default @samp{/t}) in the mode line.
1984
1985@vindex fortran-continuation-string
1986 If the text on a line starts with the Fortran continuation marker
1987specified by @code{fortran-continuation-string} (conventionally
1988@samp{$}), or if it begins with any non-whitespace character in column
19895, Fortran mode treats it as a continuation line. When you indent a
1990continuation line with @key{TAB}, it converts the line to the current
1991continuation style. When you split a Fortran statement with
1992@kbd{C-M-j}, the continuation marker on the newline is created according
1993to the continuation style.
1980 1994
1981 The setting of continuation style affects several other aspects of 1995 The setting of continuation style affects several other aspects of
1982editing in Fortran mode. In fixed format mode, the minimum column 1996editing in Fortran mode. In fixed format mode, the minimum column
@@ -1986,17 +2000,6 @@ space character for whitespace. In tab format mode, the minimum
1986column number for the statement body is 8, and the whitespace before 2000column number for the statement body is 8, and the whitespace before
1987column 8 must always consist of one tab character. 2001column 8 must always consist of one tab character.
1988 2002
1989@vindex fortran-tab-mode-default
1990@vindex fortran-analyze-depth
1991 When you enter Fortran mode for an existing file, it tries to deduce the
1992proper continuation style automatically from the file contents. The first
1993line that begins with either a tab character or six spaces determines the
1994choice. The variable @code{fortran-analyze-depth} specifies how many lines
1995to consider (at the beginning of the file); if none of those lines
1996indicates a style, then the variable @code{fortran-tab-mode-default}
1997specifies the style. If it is @code{nil}, that specifies fixed format, and
1998non-@code{nil} specifies tab format.
1999
2000@node ForIndent Num 2003@node ForIndent Num
2001@subsubsection Line Numbers 2004@subsubsection Line Numbers
2002 2005
@@ -2007,9 +2010,11 @@ through 4. (Columns always count from 0 in GNU Emacs.)
2007@vindex fortran-line-number-indent 2010@vindex fortran-line-number-indent
2008 Line numbers of four digits or less are normally indented one space. 2011 Line numbers of four digits or less are normally indented one space.
2009The variable @code{fortran-line-number-indent} controls this; it 2012The variable @code{fortran-line-number-indent} controls this; it
2010specifies the maximum indentation a line number can have. Line numbers 2013specifies the maximum indentation a line number can have. The default
2011are right-justified to end in column 4 unless that would require more 2014value of the variable is 1. Fortran mode tries to prevent line number
2012than this maximum indentation. The default value of the variable is 1. 2015digits passing column 4, reducing the indentation below the specified
2016maximum if necessary. If @code{fortran-line-number-indent} has the
2017value 5, line numbers are right-justified to end in column 4.
2013 2018
2014@vindex fortran-electric-line-number 2019@vindex fortran-electric-line-number
2015 Simply inserting a line number is enough to indent it according to 2020 Simply inserting a line number is enough to indent it according to
@@ -2063,53 +2068,58 @@ Extra indentation within each level of @samp{do} statement (default 3).
2063 2068
2064@item fortran-if-indent 2069@item fortran-if-indent
2065Extra indentation within each level of @samp{if} statement (default 3). 2070Extra indentation within each level of @samp{if} statement (default 3).
2066This value is also used for extra indentation within each level of the
2067Fortran 90 @samp{where} statement.
2068 2071
2069@item fortran-structure-indent 2072@item fortran-structure-indent
2070Extra indentation within each level of @samp{structure}, @samp{union}, or 2073Extra indentation within each level of @samp{structure}, @samp{union},
2071@samp{map} statements (default 3). 2074@samp{map}, or @samp{interface} statements (default 3).
2072 2075
2073@item fortran-continuation-indent 2076@item fortran-continuation-indent
2074Extra indentation for bodies of continuation lines (default 5). 2077Extra indentation for bodies of continuation lines (default 5).
2075 2078
2076@item fortran-check-all-num-for-matching-do 2079@item fortran-check-all-num-for-matching-do
2077If this is @code{nil}, indentation assumes that each @samp{do} statement 2080In Fortran77, a numbered @samp{do} statement is ended by any statement
2078ends on a @samp{continue} statement. Therefore, when computing 2081with a matching line number. It is common (but not compulsory) to use a
2079indentation for a statement other than @samp{continue}, it can save time 2082@samp{continue} statement for this purpose. If this variable has a
2080by not checking for a @samp{do} statement ending there. If this is 2083non-@code{nil} value, indenting any numbered statement must check for a
2081non-@code{nil}, indenting any numbered statement must check for a 2084@samp{do} that ends there. If you always end @samp{do} statements with
2082@samp{do} that ends there. The default is @code{nil}. 2085a @samp{continue} line (or if you use the more modern @samp{enddo}),
2086then you can speed up indentation by setting this variable to
2087@code{nil}. The default is @code{nil}.
2083 2088
2084@item fortran-blink-matching-if 2089@item fortran-blink-matching-if
2085If this is @code{t}, indenting an @samp{endif} statement moves the 2090If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
2086cursor momentarily to the matching @samp{if} statement to show where it 2091statement moves the cursor momentarily to the matching @samp{if} (or
2087is. The default is @code{nil}. 2092@samp{do}) statement to show where it is. The default is @code{nil}.
2088 2093
2089@item fortran-minimum-statement-indent-fixed 2094@item fortran-minimum-statement-indent-fixed
2090Minimum indentation for fortran statements when using fixed format 2095Minimum indentation for Fortran statements when using fixed format
2091continuation line style. Statement bodies are never indented less than 2096continuation line style. Statement bodies are never indented less than
2092this much. The default is 6. 2097this much. The default is 6.
2093 2098
2094@item fortran-minimum-statement-indent-tab 2099@item fortran-minimum-statement-indent-tab
2095Minimum indentation for fortran statements for tab format continuation line 2100Minimum indentation for Fortran statements for tab format continuation line
2096style. Statement bodies are never indented less than this much. The 2101style. Statement bodies are never indented less than this much. The
2097default is 8. 2102default is 8.
2098@end table 2103@end table
2099 2104
2105The variables controlling the indentation of comments are described in
2106a separate section (@pxref{Fortran Comments}).
2107
2108
2100@node Fortran Comments 2109@node Fortran Comments
2101@subsection Fortran Comments 2110@subsection Fortran Comments
2102 2111
2103 The usual Emacs comment commands assume that a comment can follow a line 2112 The usual Emacs comment commands assume that a comment can follow a
2104of code. In Fortran, the standard comment syntax requires an entire line 2113line of code. In Fortran77, the standard comment syntax requires an
2105to be just a comment. Therefore, Fortran mode replaces the standard Emacs 2114entire line to be just a comment. Therefore, Fortran mode replaces the
2106comment commands and defines some new variables. 2115standard Emacs comment commands and defines some new variables.
2107 2116
2117@vindex fortran-comment-line-start
2108 Fortran mode can also handle the Fortran90 comment syntax where comments 2118 Fortran mode can also handle the Fortran90 comment syntax where comments
2109start with @samp{!} and can follow other text. Because only some Fortran77 2119start with @samp{!} and can follow other text. Because only some Fortran77
2110compilers accept this syntax, Fortran mode will not insert such comments 2120compilers accept this syntax, Fortran mode will not insert such comments
2111unless you have said in advance to do so. To do this, set the variable 2121unless you have said in advance to do so. To do this, set the variable
2112@code{comment-start} to @samp{"!"} (@pxref{Variables}). 2122@code{fortran-comment-line-start} to @samp{"!"}.
2113 2123
2114@table @kbd 2124@table @kbd
2115@item M-; 2125@item M-;
@@ -2123,6 +2133,7 @@ Turn all lines of the region into comments, or (with argument) turn them back
2123into real code (@code{fortran-comment-region}). 2133into real code (@code{fortran-comment-region}).
2124@end table 2134@end table
2125 2135
2136@findex fortran-indent-comment
2126 @kbd{M-;} in Fortran mode is redefined as the command 2137 @kbd{M-;} in Fortran mode is redefined as the command
2127@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this 2138@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
2128recognizes any kind of existing comment and aligns its text appropriately; 2139recognizes any kind of existing comment and aligns its text appropriately;
@@ -2178,14 +2189,6 @@ never be indented at all, no matter what the value of
2178lines are directives. Matching lines are never indented, and receive 2189lines are directives. Matching lines are never indented, and receive
2179distinctive font-locking. 2190distinctive font-locking.
2180 2191
2181@vindex comment-line-start
2182@vindex comment-line-start-skip
2183 Fortran mode introduces two variables @code{comment-line-start} and
2184@code{comment-line-start-skip}, which play for full-line comments the same
2185roles played by @code{comment-start} and @code{comment-start-skip} for
2186ordinary text-following comments. Normally these are set properly by
2187Fortran mode, so you do not need to change them.
2188
2189 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If 2192 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
2190you use @samp{!} comments, this command can be used with them. Otherwise 2193you use @samp{!} comments, this command can be used with them. Otherwise
2191it is useless in Fortran mode. 2194it is useless in Fortran mode.
@@ -2204,34 +2207,28 @@ of the name never conflict because in Lisp and in Emacs it is always
2204clear from the context which one is meant. 2207clear from the context which one is meant.
2205 2208
2206@node Fortran Autofill 2209@node Fortran Autofill
2207@subsection Fortran Auto Fill Mode 2210@subsection Auto Fill in Fortran Mode
2208 2211
2209 Fortran Auto Fill mode is a minor mode which automatically splits 2212 Fortran mode has specialized support for Auto Fill mode, which is a
2210Fortran statements as you insert them when they become too wide. 2213minor mode that automatically splits statements as you insert them when
2211Splitting a statement involves making continuation lines using 2214they become too wide. Splitting a statement involves making
2212@code{fortran-continuation-string} (@pxref{ForIndent Cont}). This 2215continuation lines using @code{fortran-continuation-string}
2213splitting happens when you type @key{SPC}, @key{RET}, or @key{TAB}, and 2216(@pxref{ForIndent Cont}). This splitting happens when you type
2214also in the Fortran indentation commands. 2217@key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran indentation
2215 2218commands. You activate Auto Fill in Fortran mode in the normal way
2216@findex fortran-auto-fill-mode 2219(@pxref{Auto Fill}).
2217 @kbd{M-x fortran-auto-fill-mode} toggles Fortran Auto Fill mode,
2218which is a variant of normal Auto Fill mode (@pxref{Filling}) designed
2219for Fortran programs. Fortran Auto Fill mode is a buffer-local minor
2220mode (@pxref{Minor Modes}). When Fortran Auto Fill mode is in effect,
2221the word @samp{Fill} appears in the mode line inside the parentheses.
2222 2220
2223@vindex fortran-break-before-delimiters 2221@vindex fortran-break-before-delimiters
2224 Fortran Auto Fill mode breaks lines at spaces or delimiters when the 2222 Auto Fill breaks lines at spaces or delimiters when the lines get
2225lines get longer than the desired width (the value of @code{fill-column}). 2223longer than the desired width (the value of @code{fill-column}). The
2226The delimiters that Fortran Auto Fill mode may break at are @samp{,}, 2224delimiters (besides whitespace) that Auto Fill may break at are
2227@samp{'}, @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, and @samp{)}. 2225@samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
2228The line break comes after the delimiter if the variable 2226and @samp{,}. The line break comes after the delimiter if the variable
2229@code{fortran-break-before-delimiters} is @code{nil}. Otherwise (and by 2227@code{fortran-break-before-delimiters} is @code{nil}. Otherwise (and by
2230default), the break comes before the delimiter. 2228default), the break comes before the delimiter.
2231 2229
2232 To enable this mode permanently, add a hook function to 2230 To enable Auto Fill in all Fortran buffers, add
2233@code{fortran-mode-hook} to execute @code{(fortran-auto-fill-mode 1)}. 2231@code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks}.
2234@xref{Hooks}.
2235 2232
2236@node Fortran Columns 2233@node Fortran Columns
2237@subsection Checking Columns in Fortran 2234@subsection Checking Columns in Fortran
@@ -2280,7 +2277,7 @@ display.
2280@findex fortran-window-create-momentarily 2277@findex fortran-window-create-momentarily
2281 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily 2278 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
2282splits the current window horizontally, making a window 72 columns 2279splits the current window horizontally, making a window 72 columns
2283wide, so you can see which lines that is too long. Type a space to 2280wide, so you can see any lines that are too long. Type a space to
2284restore the normal width. 2281restore the normal width.
2285 2282
2286@kindex C-u C-c C-w @r{(Fortran mode)} 2283@kindex C-u C-c C-w @r{(Fortran mode)}