Mercurial > emacs
comparison man/programs.texi @ 61021:6fb8ff7dc693
Reformat and update copyright years.
(Fortran): Update section.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sun, 27 Mar 2005 17:16:31 +0000 |
parents | 3b533b854268 |
children | 1fd8c64d9f14 |
comparison
equal
deleted
inserted
replaced
61020:d3326c3d7c9d | 61021:6fb8ff7dc693 |
---|---|
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 |
6 @cindex Lisp editing | 7 @cindex Lisp editing |
7 @cindex C editing | 8 @cindex C editing |
1799 @node Fortran | 1800 @node Fortran |
1800 @section Fortran Mode | 1801 @section Fortran Mode |
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 |
1805 subprograms, and indentation commands that understand Fortran conventions | 1806 and subprograms, and indentation commands that understand Fortran |
1806 of nesting, line numbers and continuation statements. Fortran mode has | 1807 conventions of nesting, line numbers and continuation statements. |
1807 its own Auto Fill mode that breaks long lines into proper Fortran | 1808 Fortran mode has support for Auto Fill mode that breaks long lines into |
1808 continuation lines. | 1809 proper 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 |
1811 are unlike those of other languages. Built-in abbrevs optionally save | 1812 are unlike those of other languages. Built-in abbrevs optionally save |
1812 typing when you insert Fortran keywords. | 1813 typing when you insert Fortran keywords. |
1813 | 1814 |
1815 runs the hook @code{fortran-mode-hook} (@pxref{Hooks}). | 1816 runs the hook @code{fortran-mode-hook} (@pxref{Hooks}). |
1816 | 1817 |
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 |
1821 code. For editing the modern Fortran90 ``free format'' source code, | 1822 ``tab format'') source code. For editing the modern Fortran90 or |
1822 use F90 mode (@code{f90-mode}). Emacs normally uses Fortran mode for | 1823 Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}). |
1823 files with extension @samp{.f}, @samp{.F} or @samp{.for}, and F90 mode | 1824 Emacs normally uses Fortran mode for files with extension @samp{.f}, |
1824 for 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 |
1825 format. | 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 |
1835 | 1836 |
1836 @node Fortran Motion | 1837 @node Fortran Motion |
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 |
1841 mode provides special commands to move by statements. | 1842 modules for F90 mode), Fortran mode provides special commands to move by |
1843 statements. | |
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)} |
1845 @findex fortran-next-statement | 1847 @findex fortran-next-statement |
1846 @findex f90-next-statement | 1848 @findex f90-next-statement |
1894 @subsection Fortran Indentation | 1896 @subsection Fortran Indentation |
1895 | 1897 |
1896 Special commands and features are needed for indenting Fortran code in | 1898 Special commands and features are needed for indenting Fortran code in |
1897 order to make sure various syntactic entities (line numbers, comment line | 1899 order to make sure various syntactic entities (line numbers, comment line |
1898 indicators and continuation line flags) appear in the columns that are | 1900 indicators and continuation line flags) appear in the columns that are |
1899 required for standard Fortran. | 1901 required 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. |
1903 * Contline: ForIndent Cont. How continuation lines indent. | 1905 * Contline: ForIndent Cont. How continuation lines indent. |
1904 * Numbers: ForIndent Num. How line numbers auto-indent. | 1906 * Numbers: ForIndent Num. How line numbers auto-indent. |
1909 @node ForIndent Commands | 1911 @node ForIndent Commands |
1910 @subsubsection Fortran Indentation and Filling Commands | 1912 @subsubsection Fortran Indentation and Filling Commands |
1911 | 1913 |
1912 @table @kbd | 1914 @table @kbd |
1913 @item C-M-j | 1915 @item C-M-j |
1914 Break the current line and set up a continuation line | 1916 Break 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-^ |
1917 Join this line to the previous line (@code{fortran-join-line}). | 1919 Join this line to the previous line (@code{fortran-join-line}). |
1918 @item C-M-q | 1920 @item C-M-q |
1919 Indent all the lines of the subprogram point is in | 1921 Indent all the lines of the subprogram point is in |
1951 @node ForIndent Cont | 1953 @node ForIndent Cont |
1952 @subsubsection Continuation Lines | 1954 @subsubsection Continuation Lines |
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. |
1957 lines. If the first non-space character on a line is in column 5, then | 1959 If the first non-space character on a line is in column 5, then that |
1958 that line is a continuation of the previous line. We call this | 1960 line 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 | 1961 format}. (In GNU Emacs we always count columns from 0; but note that |
1960 variable @code{fortran-continuation-string} specifies what character to | 1962 the Fortran standard counts from 1.) The variable |
1961 put on column 5. A line that starts with a tab character followed by | 1963 @code{fortran-continuation-string} specifies what character to put in |
1962 any digit except @samp{0} is also a continuation line. We call this | 1964 column 5. A line that starts with a tab character followed by any digit |
1963 style of continuation @dfn{tab format}. | 1965 except @samp{0} is also a continuation line. We call this style of |
1966 continuation @dfn{tab format}. (Fortran90 introduced ``free format'', | |
1967 with 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 |
1967 must 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 |
1969 format, and non-@code{nil} for tab format. You can tell which style | 1973 Fortran mode can use either style of continuation line. When you |
1970 is presently in effect by the presence or absence of the string | 1974 enter Fortran mode, it tries to deduce the proper continuation style |
1971 @samp{Tab} in the mode line. | 1975 automatically 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 | 1977 buffer. The first line that begins with either a tab character or six |
1974 continuation marker @samp{$}, or if it begins with any non-whitespace | 1978 spaces determines the choice. If the scan fails (for example, if the |
1975 character in column 5, Fortran mode treats it as a continuation line. | 1979 buffer is new and therefore empty), the value of |
1976 When you indent a continuation line with @key{TAB}, it converts the line | 1980 @code{fortran-tab-mode-default} (@code{nil} for fixed format, and |
1977 to the current continuation style. When you split a Fortran statement | 1981 non-@code{nil} for tab format) is used. You can tell which style is |
1978 with @kbd{C-M-j}, the continuation marker on the newline is created | 1982 presently in effect by the presence or absence of the string specified |
1979 according to the continuation style. | 1983 by @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 | |
1987 specified by @code{fortran-continuation-string} (conventionally | |
1988 @samp{$}), or if it begins with any non-whitespace character in column | |
1989 5, Fortran mode treats it as a continuation line. When you indent a | |
1990 continuation line with @key{TAB}, it converts the line to the current | |
1991 continuation style. When you split a Fortran statement with | |
1992 @kbd{C-M-j}, the continuation marker on the newline is created according | |
1993 to 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 |
1982 editing in Fortran mode. In fixed format mode, the minimum column | 1996 editing in Fortran mode. In fixed format mode, the minimum column |
1983 number for the body of a statement is 6. Lines inside of Fortran | 1997 number for the body of a statement is 6. Lines inside of Fortran |
1984 blocks that are indented to larger column numbers always use only the | 1998 blocks that are indented to larger column numbers always use only the |
1985 space character for whitespace. In tab format mode, the minimum | 1999 space character for whitespace. In tab format mode, the minimum |
1986 column number for the statement body is 8, and the whitespace before | 2000 column number for the statement body is 8, and the whitespace before |
1987 column 8 must always consist of one tab character. | 2001 column 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 | |
1992 proper continuation style automatically from the file contents. The first | |
1993 line that begins with either a tab character or six spaces determines the | |
1994 choice. The variable @code{fortran-analyze-depth} specifies how many lines | |
1995 to consider (at the beginning of the file); if none of those lines | |
1996 indicates a style, then the variable @code{fortran-tab-mode-default} | |
1997 specifies the style. If it is @code{nil}, that specifies fixed format, and | |
1998 non-@code{nil} specifies tab format. | |
1999 | |
2000 @node ForIndent Num | 2003 @node ForIndent Num |
2001 @subsubsection Line Numbers | 2004 @subsubsection Line Numbers |
2002 | 2005 |
2003 If a number is the first non-whitespace in the line, Fortran | 2006 If a number is the first non-whitespace in the line, Fortran |
2004 indentation assumes it is a line number and moves it to columns 0 | 2007 indentation assumes it is a line number and moves it to columns 0 |
2005 through 4. (Columns always count from 0 in GNU Emacs.) | 2008 through 4. (Columns always count from 0 in GNU Emacs.) |
2006 | 2009 |
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. |
2009 The variable @code{fortran-line-number-indent} controls this; it | 2012 The variable @code{fortran-line-number-indent} controls this; it |
2010 specifies the maximum indentation a line number can have. Line numbers | 2013 specifies the maximum indentation a line number can have. The default |
2011 are right-justified to end in column 4 unless that would require more | 2014 value of the variable is 1. Fortran mode tries to prevent line number |
2012 than this maximum indentation. The default value of the variable is 1. | 2015 digits passing column 4, reducing the indentation below the specified |
2016 maximum if necessary. If @code{fortran-line-number-indent} has the | |
2017 value 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 |
2016 these rules. As each digit is inserted, the indentation is recomputed. | 2021 these rules. As each digit is inserted, the indentation is recomputed. |
2017 To turn off this feature, set the variable | 2022 To turn off this feature, set the variable |
2061 @item fortran-do-indent | 2066 @item fortran-do-indent |
2062 Extra indentation within each level of @samp{do} statement (default 3). | 2067 Extra indentation within each level of @samp{do} statement (default 3). |
2063 | 2068 |
2064 @item fortran-if-indent | 2069 @item fortran-if-indent |
2065 Extra indentation within each level of @samp{if} statement (default 3). | 2070 Extra indentation within each level of @samp{if} statement (default 3). |
2066 This value is also used for extra indentation within each level of the | |
2067 Fortran 90 @samp{where} statement. | |
2068 | 2071 |
2069 @item fortran-structure-indent | 2072 @item fortran-structure-indent |
2070 Extra indentation within each level of @samp{structure}, @samp{union}, or | 2073 Extra 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 |
2074 Extra indentation for bodies of continuation lines (default 5). | 2077 Extra 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 |
2077 If this is @code{nil}, indentation assumes that each @samp{do} statement | 2080 In Fortran77, a numbered @samp{do} statement is ended by any statement |
2078 ends on a @samp{continue} statement. Therefore, when computing | 2081 with a matching line number. It is common (but not compulsory) to use a |
2079 indentation for a statement other than @samp{continue}, it can save time | 2082 @samp{continue} statement for this purpose. If this variable has a |
2080 by not checking for a @samp{do} statement ending there. If this is | 2083 non-@code{nil} value, indenting any numbered statement must check for a |
2081 non-@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}. | 2085 a @samp{continue} line (or if you use the more modern @samp{enddo}), |
2086 then 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 |
2085 If this is @code{t}, indenting an @samp{endif} statement moves the | 2090 If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} |
2086 cursor momentarily to the matching @samp{if} statement to show where it | 2091 statement moves the cursor momentarily to the matching @samp{if} (or |
2087 is. 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 |
2090 Minimum indentation for fortran statements when using fixed format | 2095 Minimum indentation for Fortran statements when using fixed format |
2091 continuation line style. Statement bodies are never indented less than | 2096 continuation line style. Statement bodies are never indented less than |
2092 this much. The default is 6. | 2097 this much. The default is 6. |
2093 | 2098 |
2094 @item fortran-minimum-statement-indent-tab | 2099 @item fortran-minimum-statement-indent-tab |
2095 Minimum indentation for fortran statements for tab format continuation line | 2100 Minimum indentation for Fortran statements for tab format continuation line |
2096 style. Statement bodies are never indented less than this much. The | 2101 style. Statement bodies are never indented less than this much. The |
2097 default is 8. | 2102 default is 8. |
2098 @end table | 2103 @end table |
2099 | 2104 |
2105 The variables controlling the indentation of comments are described in | |
2106 a 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 |
2104 of code. In Fortran, the standard comment syntax requires an entire line | 2113 line of code. In Fortran77, the standard comment syntax requires an |
2105 to be just a comment. Therefore, Fortran mode replaces the standard Emacs | 2114 entire line to be just a comment. Therefore, Fortran mode replaces the |
2106 comment commands and defines some new variables. | 2115 standard 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 |
2109 start with @samp{!} and can follow other text. Because only some Fortran77 | 2119 start with @samp{!} and can follow other text. Because only some Fortran77 |
2110 compilers accept this syntax, Fortran mode will not insert such comments | 2120 compilers accept this syntax, Fortran mode will not insert such comments |
2111 unless you have said in advance to do so. To do this, set the variable | 2121 unless 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-; |
2116 Align comment or insert new comment (@code{fortran-indent-comment}). | 2126 Align comment or insert new comment (@code{fortran-indent-comment}). |
2117 | 2127 |
2121 @item C-c ; | 2131 @item C-c ; |
2122 Turn all lines of the region into comments, or (with argument) turn them back | 2132 Turn all lines of the region into comments, or (with argument) turn them back |
2123 into real code (@code{fortran-comment-region}). | 2133 into 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 |
2128 recognizes any kind of existing comment and aligns its text appropriately; | 2139 recognizes any kind of existing comment and aligns its text appropriately; |
2129 if there is no existing comment, a comment is inserted and aligned. But | 2140 if there is no existing comment, a comment is inserted and aligned. But |
2130 inserting and aligning comments are not the same in Fortran mode as in | 2141 inserting and aligning comments are not the same in Fortran mode as in |
2175 never be indented at all, no matter what the value of | 2186 never be indented at all, no matter what the value of |
2176 @code{fortran-comment-indent-style}. The variable | 2187 @code{fortran-comment-indent-style}. The variable |
2177 @code{fortran-directive-re} is a regular expression that specifies which | 2188 @code{fortran-directive-re} is a regular expression that specifies which |
2178 lines are directives. Matching lines are never indented, and receive | 2189 lines are directives. Matching lines are never indented, and receive |
2179 distinctive font-locking. | 2190 distinctive font-locking. |
2180 | |
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 | |
2185 roles played by @code{comment-start} and @code{comment-start-skip} for | |
2186 ordinary text-following comments. Normally these are set properly by | |
2187 Fortran mode, so you do not need to change them. | |
2188 | 2191 |
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 |
2190 you use @samp{!} comments, this command can be used with them. Otherwise | 2193 you use @samp{!} comments, this command can be used with them. Otherwise |
2191 it is useless in Fortran mode. | 2194 it is useless in Fortran mode. |
2192 | 2195 |
2202 example of a command and a variable with the same name; these two uses | 2205 example of a command and a variable with the same name; these two uses |
2203 of the name never conflict because in Lisp and in Emacs it is always | 2206 of the name never conflict because in Lisp and in Emacs it is always |
2204 clear from the context which one is meant. | 2207 clear 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 |
2210 Fortran statements as you insert them when they become too wide. | 2213 minor mode that automatically splits statements as you insert them when |
2211 Splitting a statement involves making continuation lines using | 2214 they become too wide. Splitting a statement involves making |
2212 @code{fortran-continuation-string} (@pxref{ForIndent Cont}). This | 2215 continuation lines using @code{fortran-continuation-string} |
2213 splitting happens when you type @key{SPC}, @key{RET}, or @key{TAB}, and | 2216 (@pxref{ForIndent Cont}). This splitting happens when you type |
2214 also in the Fortran indentation commands. | 2217 @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran indentation |
2215 | 2218 commands. 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, | |
2218 which is a variant of normal Auto Fill mode (@pxref{Filling}) designed | |
2219 for Fortran programs. Fortran Auto Fill mode is a buffer-local minor | |
2220 mode (@pxref{Minor Modes}). When Fortran Auto Fill mode is in effect, | |
2221 the 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 |
2225 lines get longer than the desired width (the value of @code{fill-column}). | 2223 longer than the desired width (the value of @code{fill-column}). The |
2226 The delimiters that Fortran Auto Fill mode may break at are @samp{,}, | 2224 delimiters (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{>}, |
2228 The line break comes after the delimiter if the variable | 2226 and @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 |
2230 default), the break comes before the delimiter. | 2228 default), 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 |
2238 | 2235 |
2239 @table @kbd | 2236 @table @kbd |
2278 | 2275 |
2279 @kindex C-c C-w @r{(Fortran mode)} | 2276 @kindex C-c C-w @r{(Fortran mode)} |
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 |
2282 splits the current window horizontally, making a window 72 columns | 2279 splits the current window horizontally, making a window 72 columns |
2283 wide, so you can see which lines that is too long. Type a space to | 2280 wide, so you can see any lines that are too long. Type a space to |
2284 restore the normal width. | 2281 restore 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)} |
2287 @findex fortran-window-create | 2284 @findex fortran-window-create |
2288 You can also split the window horizontally and continue editing with | 2285 You can also split the window horizontally and continue editing with |