diff options
| author | Karoly Lorentey | 2005-04-04 16:43:15 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-04-04 16:43:15 +0000 |
| commit | ee00ea6e18c2aeae86e262fae703f67f4705032a (patch) | |
| tree | 9e7fc6bfb33de2b2f861589a2f7674ad35de85a8 /man/programs.texi | |
| parent | 4a932511428a2b61ec51deebd6e16ec1efbda800 (diff) | |
| parent | 8c6ef2ca34c444c1dea1f11b999b4b2ec16cdea3 (diff) | |
| download | emacs-ee00ea6e18c2aeae86e262fae703f67f4705032a.tar.gz emacs-ee00ea6e18c2aeae86e262fae703f67f4705032a.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 45-55, 214-231)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-214
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-215
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-216
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-217
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-218
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-219
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-221
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-222
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-223
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-224
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-225
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-226
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-227
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-228
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-229
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-230
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-231
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-45
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-46
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-47
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-48
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-49
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-50
Update from CVS: texi Makefile.in CVS keyw cruft
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-51
Update from CVS: ChangeLog tweaks
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-52
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-53
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-54
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-55
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-324
Diffstat (limited to 'man/programs.texi')
| -rw-r--r-- | man/programs.texi | 247 |
1 files changed, 123 insertions, 124 deletions
diff --git a/man/programs.texi b/man/programs.texi index 353cb85aa60..98e60d0385c 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 |
| @@ -80,17 +81,19 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. | |||
| 80 | @cindex Shell-script mode | 81 | @cindex Shell-script mode |
| 81 | @cindex Delphi mode | 82 | @cindex Delphi mode |
| 82 | @cindex PostScript mode | 83 | @cindex PostScript mode |
| 84 | @cindex Conf mode | ||
| 85 | @cindex DNS mode | ||
| 83 | The existing programming language major modes include Lisp, Scheme (a | 86 | The existing programming language major modes include Lisp, Scheme (a |
| 84 | variant of Lisp) and the Scheme-based DSSSL expression language, Ada, | 87 | variant of Lisp) and the Scheme-based DSSSL expression language, Ada, |
| 85 | ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed | 88 | ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed |
| 86 | format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s | 89 | format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s |
| 87 | companion for font creation), Modula2, Objective-C, Octave, Pascal, | 90 | companion for font creation), Modula2, Objective-C, Octave, Pascal, |
| 88 | Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. There is | 91 | Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. An |
| 89 | also a major mode for makefiles, called Makefile mode. An alternative | 92 | alternative mode for Perl is called CPerl mode. Modes are available for |
| 90 | mode for Perl is called CPerl mode. Modes are available for the | 93 | the scripting languages of the common GNU and Unix shells, VMS DCL, and |
| 91 | scripting languages of the common GNU and Unix shells, VMS DCL, and | ||
| 92 | MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for | 94 | MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for |
| 93 | editing various sorts of configuration files. | 95 | editing makefiles, DNS master files, and various sorts of configuration |
| 96 | files. | ||
| 94 | 97 | ||
| 95 | @kindex DEL @r{(programming modes)} | 98 | @kindex DEL @r{(programming modes)} |
| 96 | @findex c-electric-backspace | 99 | @findex c-electric-backspace |
| @@ -1801,11 +1804,11 @@ names. | |||
| 1801 | @cindex Fortran mode | 1804 | @cindex Fortran mode |
| 1802 | @cindex mode, Fortran | 1805 | @cindex mode, Fortran |
| 1803 | 1806 | ||
| 1804 | Fortran mode provides special motion commands for Fortran statements and | 1807 | Fortran mode provides special motion commands for Fortran statements |
| 1805 | subprograms, and indentation commands that understand Fortran conventions | 1808 | and subprograms, and indentation commands that understand Fortran |
| 1806 | of nesting, line numbers and continuation statements. Fortran mode has | 1809 | conventions of nesting, line numbers and continuation statements. |
| 1807 | its own Auto Fill mode that breaks long lines into proper Fortran | 1810 | Fortran mode has support for Auto Fill mode that breaks long lines into |
| 1808 | continuation lines. | 1811 | proper Fortran continuation lines. |
| 1809 | 1812 | ||
| 1810 | Special commands for comments are provided because Fortran comments | 1813 | Special commands for comments are provided because Fortran comments |
| 1811 | are unlike those of other languages. Built-in abbrevs optionally save | 1814 | are unlike those of other languages. Built-in abbrevs optionally save |
| @@ -1817,18 +1820,18 @@ runs the hook @code{fortran-mode-hook} (@pxref{Hooks}). | |||
| 1817 | @cindex Fortran77 and Fortran90 | 1820 | @cindex Fortran77 and Fortran90 |
| 1818 | @findex f90-mode | 1821 | @findex f90-mode |
| 1819 | @findex fortran-mode | 1822 | @findex fortran-mode |
| 1820 | Fortran mode is meant for editing Fortran77 ``fixed format'' source | 1823 | Fortran mode is meant for editing Fortran77 ``fixed format'' (and also |
| 1821 | code. For editing the modern Fortran90 ``free format'' source code, | 1824 | ``tab format'') source code. For editing the modern Fortran90 or |
| 1822 | use F90 mode (@code{f90-mode}). Emacs normally uses Fortran mode for | 1825 | 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 | 1826 | Emacs normally uses Fortran mode for files with extension @samp{.f}, |
| 1824 | for the extension @samp{.f90}. GNU Fortran supports both kinds of | 1827 | @samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and |
| 1825 | format. | 1828 | @samp{.f95}. GNU Fortran supports both kinds of format. |
| 1826 | 1829 | ||
| 1827 | @menu | 1830 | @menu |
| 1828 | * Motion: Fortran Motion. Moving point by statements or subprograms. | 1831 | * Motion: Fortran Motion. Moving point by statements or subprograms. |
| 1829 | * Indent: Fortran Indent. Indentation commands for Fortran. | 1832 | * Indent: Fortran Indent. Indentation commands for Fortran. |
| 1830 | * Comments: Fortran Comments. Inserting and aligning comments. | 1833 | * Comments: Fortran Comments. Inserting and aligning comments. |
| 1831 | * Autofill: Fortran Autofill. Auto fill minor mode for Fortran. | 1834 | * Autofill: Fortran Autofill. Auto fill support for Fortran. |
| 1832 | * Columns: Fortran Columns. Measuring columns for valid Fortran. | 1835 | * Columns: Fortran Columns. Measuring columns for valid Fortran. |
| 1833 | * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. | 1836 | * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. |
| 1834 | @end menu | 1837 | @end menu |
| @@ -1837,8 +1840,9 @@ format. | |||
| 1837 | @subsection Motion Commands | 1840 | @subsection Motion Commands |
| 1838 | 1841 | ||
| 1839 | In addition to the normal commands for moving by and operating on | 1842 | In addition to the normal commands for moving by and operating on |
| 1840 | ``defuns'' (Fortran subprograms---functions and subroutines), Fortran | 1843 | ``defuns'' (Fortran subprograms---functions and subroutines, as well as |
| 1841 | mode provides special commands to move by statements. | 1844 | modules for F90 mode), Fortran mode provides special commands to move by |
| 1845 | statements and other program units. | ||
| 1842 | 1846 | ||
| 1843 | @table @kbd | 1847 | @table @kbd |
| 1844 | @kindex C-c C-n @r{(Fortran mode)} | 1848 | @kindex C-c C-n @r{(Fortran mode)} |
| @@ -1873,21 +1877,24 @@ Move point backward to the previous code block | |||
| 1873 | (@code{f90-previous-block}). This is like @code{f90-next-block}, but | 1877 | (@code{f90-previous-block}). This is like @code{f90-next-block}, but |
| 1874 | moves backwards. | 1878 | moves backwards. |
| 1875 | 1879 | ||
| 1876 | @kindex C-M-n @r{(F90 mode)} | 1880 | @kindex C-M-n @r{(Fortran mode)} |
| 1881 | @findex fortran-end-of-block | ||
| 1877 | @findex f90-end-of-block | 1882 | @findex f90-end-of-block |
| 1878 | @item C-M-n | 1883 | @item C-M-n |
| 1879 | Move to the end of the current code block (@code{f90-end-of-block}). | 1884 | Move to the end of the current code block |
| 1880 | This is for F90 mode only. With a numeric agument, move forward that | 1885 | (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric |
| 1881 | number of blocks. This command checks for consistency of block types | 1886 | agument, move forward that number of blocks. The mark is set before |
| 1882 | and labels (if present), but it does not check the outermost block | 1887 | moving point. The F90 mode version of this command checks for |
| 1883 | since that may be incomplete. The mark is set before moving point. | 1888 | consistency of block types and labels (if present), but it does not |
| 1884 | 1889 | check the outermost block since that may be incomplete. | |
| 1885 | @kindex C-M-p @r{(F90 mode)} | 1890 | |
| 1891 | @kindex C-M-p @r{(Fortran mode)} | ||
| 1892 | @findex fortran-beginning-of-block | ||
| 1886 | @findex f90-beginning-of-block | 1893 | @findex f90-beginning-of-block |
| 1887 | @item C-M-p | 1894 | @item C-M-p |
| 1888 | Move to the start of the current code block | 1895 | Move to the start of the current code block |
| 1889 | (@code{f90-beginning-of-block}). This is like @code{f90-end-of-block}, | 1896 | (@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This |
| 1890 | but moves backwards. | 1897 | is like @code{fortran-end-of-block}, but moves backwards. |
| 1891 | @end table | 1898 | @end table |
| 1892 | 1899 | ||
| 1893 | @node Fortran Indent | 1900 | @node Fortran Indent |
| @@ -1896,7 +1903,7 @@ but moves backwards. | |||
| 1896 | Special commands and features are needed for indenting Fortran code in | 1903 | Special commands and features are needed for indenting Fortran code in |
| 1897 | order to make sure various syntactic entities (line numbers, comment line | 1904 | order to make sure various syntactic entities (line numbers, comment line |
| 1898 | indicators and continuation line flags) appear in the columns that are | 1905 | indicators and continuation line flags) appear in the columns that are |
| 1899 | required for standard Fortran. | 1906 | required for standard, fixed (or tab) format Fortran. |
| 1900 | 1907 | ||
| 1901 | @menu | 1908 | @menu |
| 1902 | * Commands: ForIndent Commands. Commands for indenting and filling Fortran. | 1909 | * Commands: ForIndent Commands. Commands for indenting and filling Fortran. |
| @@ -1911,7 +1918,7 @@ required for standard Fortran. | |||
| 1911 | 1918 | ||
| 1912 | @table @kbd | 1919 | @table @kbd |
| 1913 | @item C-M-j | 1920 | @item C-M-j |
| 1914 | Break the current line and set up a continuation line | 1921 | Break the current line at point and set up a continuation line |
| 1915 | (@code{fortran-split-line}). | 1922 | (@code{fortran-split-line}). |
| 1916 | @item M-^ | 1923 | @item M-^ |
| 1917 | Join this line to the previous line (@code{fortran-join-line}). | 1924 | Join this line to the previous line (@code{fortran-join-line}). |
| @@ -1953,30 +1960,39 @@ point is in. This removes any excess statement continuations. | |||
| 1953 | @cindex Fortran continuation lines | 1960 | @cindex Fortran continuation lines |
| 1954 | 1961 | ||
| 1955 | @vindex fortran-continuation-string | 1962 | @vindex fortran-continuation-string |
| 1956 | Most modern Fortran compilers allow two ways of writing continuation | 1963 | 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 | 1964 | 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 | 1965 | 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 | 1966 | format}. (In GNU Emacs we always count columns from 0; but note that |
| 1960 | variable @code{fortran-continuation-string} specifies what character to | 1967 | the Fortran standard counts from 1.) The variable |
| 1961 | put on column 5. A line that starts with a tab character followed by | 1968 | @code{fortran-continuation-string} specifies what character to put in |
| 1962 | any digit except @samp{0} is also a continuation line. We call this | 1969 | column 5. A line that starts with a tab character followed by any digit |
| 1963 | style of continuation @dfn{tab format}. | 1970 | except @samp{0} is also a continuation line. We call this style of |
| 1971 | continuation @dfn{tab format}. (Fortran90 introduced ``free format'', | ||
| 1972 | with another style of continuation lines). | ||
| 1964 | 1973 | ||
| 1965 | @vindex indent-tabs-mode @r{(Fortran mode)} | 1974 | @vindex indent-tabs-mode @r{(Fortran mode)} |
| 1966 | Fortran mode can make either style of continuation line, but you | 1975 | @vindex fortran-analyze-depth |
| 1967 | must specify which one you prefer. The value of the variable | 1976 | @vindex fortran-tab-mode-default |
| 1968 | @code{indent-tabs-mode} controls the choice: @code{nil} for fixed | 1977 | Fortran mode can use either style of continuation line. When you |
| 1969 | format, and non-@code{nil} for tab format. You can tell which style | 1978 | enter Fortran mode, it tries to deduce the proper continuation style |
| 1970 | is presently in effect by the presence or absence of the string | 1979 | automatically from the buffer contents. It does this by scanning up to |
| 1971 | @samp{Tab} in the mode line. | 1980 | @code{fortran-analyze-depth} (default 100) lines from the start of the |
| 1972 | 1981 | buffer. The first line that begins with either a tab character or six | |
| 1973 | If the text on a line starts with the conventional Fortran | 1982 | spaces determines the choice. If the scan fails (for example, if the |
| 1974 | continuation marker @samp{$}, or if it begins with any non-whitespace | 1983 | buffer is new and therefore empty), the value of |
| 1975 | character in column 5, Fortran mode treats it as a continuation line. | 1984 | @code{fortran-tab-mode-default} (@code{nil} for fixed format, and |
| 1976 | When you indent a continuation line with @key{TAB}, it converts the line | 1985 | non-@code{nil} for tab format) is used. @samp{/t} in the mode line |
| 1977 | to the current continuation style. When you split a Fortran statement | 1986 | indicates tab format is selected. Fortran mode sets the value of |
| 1978 | with @kbd{C-M-j}, the continuation marker on the newline is created | 1987 | @code{indent-tabs-mode} accordingly (@pxref{Just Spaces}). |
| 1979 | according to the continuation style. | 1988 | |
| 1989 | If the text on a line starts with the Fortran continuation marker | ||
| 1990 | @samp{$}, or if it begins with any non-whitespace character in column | ||
| 1991 | 5, Fortran mode treats it as a continuation line. When you indent a | ||
| 1992 | continuation line with @key{TAB}, it converts the line to the current | ||
| 1993 | continuation style. When you split a Fortran statement with | ||
| 1994 | @kbd{C-M-j}, the continuation marker on the newline is created according | ||
| 1995 | to the continuation style. | ||
| 1980 | 1996 | ||
| 1981 | The setting of continuation style affects several other aspects of | 1997 | The setting of continuation style affects several other aspects of |
| 1982 | editing in Fortran mode. In fixed format mode, the minimum column | 1998 | editing in Fortran mode. In fixed format mode, the minimum column |
| @@ -1986,17 +2002,6 @@ space character for whitespace. In tab format mode, the minimum | |||
| 1986 | column number for the statement body is 8, and the whitespace before | 2002 | column number for the statement body is 8, and the whitespace before |
| 1987 | column 8 must always consist of one tab character. | 2003 | column 8 must always consist of one tab character. |
| 1988 | 2004 | ||
| 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 | 2005 | @node ForIndent Num |
| 2001 | @subsubsection Line Numbers | 2006 | @subsubsection Line Numbers |
| 2002 | 2007 | ||
| @@ -2007,9 +2012,11 @@ through 4. (Columns always count from 0 in GNU Emacs.) | |||
| 2007 | @vindex fortran-line-number-indent | 2012 | @vindex fortran-line-number-indent |
| 2008 | Line numbers of four digits or less are normally indented one space. | 2013 | Line numbers of four digits or less are normally indented one space. |
| 2009 | The variable @code{fortran-line-number-indent} controls this; it | 2014 | The variable @code{fortran-line-number-indent} controls this; it |
| 2010 | specifies the maximum indentation a line number can have. Line numbers | 2015 | 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 | 2016 | 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. | 2017 | digits passing column 4, reducing the indentation below the specified |
| 2018 | maximum if necessary. If @code{fortran-line-number-indent} has the | ||
| 2019 | value 5, line numbers are right-justified to end in column 4. | ||
| 2013 | 2020 | ||
| 2014 | @vindex fortran-electric-line-number | 2021 | @vindex fortran-electric-line-number |
| 2015 | Simply inserting a line number is enough to indent it according to | 2022 | Simply inserting a line number is enough to indent it according to |
| @@ -2062,54 +2069,59 @@ followed. | |||
| 2062 | Extra indentation within each level of @samp{do} statement (default 3). | 2069 | Extra indentation within each level of @samp{do} statement (default 3). |
| 2063 | 2070 | ||
| 2064 | @item fortran-if-indent | 2071 | @item fortran-if-indent |
| 2065 | Extra indentation within each level of @samp{if} statement (default 3). | 2072 | Extra indentation within each level of @samp{if}, @samp{select case}, or |
| 2066 | This value is also used for extra indentation within each level of the | 2073 | @samp{where} statements (default 3). |
| 2067 | Fortran 90 @samp{where} statement. | ||
| 2068 | 2074 | ||
| 2069 | @item fortran-structure-indent | 2075 | @item fortran-structure-indent |
| 2070 | Extra indentation within each level of @samp{structure}, @samp{union}, or | 2076 | Extra indentation within each level of @samp{structure}, @samp{union}, |
| 2071 | @samp{map} statements (default 3). | 2077 | @samp{map}, or @samp{interface} statements (default 3). |
| 2072 | 2078 | ||
| 2073 | @item fortran-continuation-indent | 2079 | @item fortran-continuation-indent |
| 2074 | Extra indentation for bodies of continuation lines (default 5). | 2080 | Extra indentation for bodies of continuation lines (default 5). |
| 2075 | 2081 | ||
| 2076 | @item fortran-check-all-num-for-matching-do | 2082 | @item fortran-check-all-num-for-matching-do |
| 2077 | If this is @code{nil}, indentation assumes that each @samp{do} statement | 2083 | In Fortran77, a numbered @samp{do} statement is ended by any statement |
| 2078 | ends on a @samp{continue} statement. Therefore, when computing | 2084 | 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 | 2085 | @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 | 2086 | non-@code{nil} value, indenting any numbered statement must check for a |
| 2081 | non-@code{nil}, indenting any numbered statement must check for a | 2087 | @samp{do} that ends there. If you always end @samp{do} statements with |
| 2082 | @samp{do} that ends there. The default is @code{nil}. | 2088 | a @samp{continue} line (or if you use the more modern @samp{enddo}), |
| 2089 | then you can speed up indentation by setting this variable to | ||
| 2090 | @code{nil}. The default is @code{nil}. | ||
| 2083 | 2091 | ||
| 2084 | @item fortran-blink-matching-if | 2092 | @item fortran-blink-matching-if |
| 2085 | If this is @code{t}, indenting an @samp{endif} statement moves the | 2093 | 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 | 2094 | statement moves the cursor momentarily to the matching @samp{if} (or |
| 2087 | is. The default is @code{nil}. | 2095 | @samp{do}) statement to show where it is. The default is @code{nil}. |
| 2088 | 2096 | ||
| 2089 | @item fortran-minimum-statement-indent-fixed | 2097 | @item fortran-minimum-statement-indent-fixed |
| 2090 | Minimum indentation for fortran statements when using fixed format | 2098 | Minimum indentation for Fortran statements when using fixed format |
| 2091 | continuation line style. Statement bodies are never indented less than | 2099 | continuation line style. Statement bodies are never indented less than |
| 2092 | this much. The default is 6. | 2100 | this much. The default is 6. |
| 2093 | 2101 | ||
| 2094 | @item fortran-minimum-statement-indent-tab | 2102 | @item fortran-minimum-statement-indent-tab |
| 2095 | Minimum indentation for fortran statements for tab format continuation line | 2103 | Minimum indentation for Fortran statements for tab format continuation line |
| 2096 | style. Statement bodies are never indented less than this much. The | 2104 | style. Statement bodies are never indented less than this much. The |
| 2097 | default is 8. | 2105 | default is 8. |
| 2098 | @end table | 2106 | @end table |
| 2099 | 2107 | ||
| 2108 | The variables controlling the indentation of comments are described in | ||
| 2109 | the following section. | ||
| 2110 | |||
| 2100 | @node Fortran Comments | 2111 | @node Fortran Comments |
| 2101 | @subsection Fortran Comments | 2112 | @subsection Fortran Comments |
| 2102 | 2113 | ||
| 2103 | The usual Emacs comment commands assume that a comment can follow a line | 2114 | 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 | 2115 | line of code. In Fortran77, the standard comment syntax requires an |
| 2105 | to be just a comment. Therefore, Fortran mode replaces the standard Emacs | 2116 | entire line to be just a comment. Therefore, Fortran mode replaces the |
| 2106 | comment commands and defines some new variables. | 2117 | standard Emacs comment commands and defines some new variables. |
| 2107 | 2118 | ||
| 2119 | @vindex fortran-comment-line-start | ||
| 2108 | Fortran mode can also handle the Fortran90 comment syntax where comments | 2120 | Fortran mode can also handle the Fortran90 comment syntax where comments |
| 2109 | start with @samp{!} and can follow other text. Because only some Fortran77 | 2121 | start with @samp{!} and can follow other text. Because only some Fortran77 |
| 2110 | compilers accept this syntax, Fortran mode will not insert such comments | 2122 | 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 | 2123 | unless you have said in advance to do so. To do this, set the variable |
| 2112 | @code{comment-start} to @samp{"!"} (@pxref{Variables}). | 2124 | @code{fortran-comment-line-start} to @samp{"!"}. |
| 2113 | 2125 | ||
| 2114 | @table @kbd | 2126 | @table @kbd |
| 2115 | @item M-; | 2127 | @item M-; |
| @@ -2123,6 +2135,7 @@ Turn all lines of the region into comments, or (with argument) turn them back | |||
| 2123 | into real code (@code{fortran-comment-region}). | 2135 | into real code (@code{fortran-comment-region}). |
| 2124 | @end table | 2136 | @end table |
| 2125 | 2137 | ||
| 2138 | @findex fortran-indent-comment | ||
| 2126 | @kbd{M-;} in Fortran mode is redefined as the command | 2139 | @kbd{M-;} in Fortran mode is redefined as the command |
| 2127 | @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this | 2140 | @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this |
| 2128 | recognizes any kind of existing comment and aligns its text appropriately; | 2141 | recognizes any kind of existing comment and aligns its text appropriately; |
| @@ -2178,14 +2191,6 @@ never be indented at all, no matter what the value of | |||
| 2178 | lines are directives. Matching lines are never indented, and receive | 2191 | lines are directives. Matching lines are never indented, and receive |
| 2179 | distinctive font-locking. | 2192 | distinctive font-locking. |
| 2180 | 2193 | ||
| 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 | |||
| 2189 | The normal Emacs comment command @kbd{C-x ;} has not been redefined. If | 2194 | 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 | 2195 | you use @samp{!} comments, this command can be used with them. Otherwise |
| 2191 | it is useless in Fortran mode. | 2196 | it is useless in Fortran mode. |
| @@ -2204,34 +2209,28 @@ of the name never conflict because in Lisp and in Emacs it is always | |||
| 2204 | clear from the context which one is meant. | 2209 | clear from the context which one is meant. |
| 2205 | 2210 | ||
| 2206 | @node Fortran Autofill | 2211 | @node Fortran Autofill |
| 2207 | @subsection Fortran Auto Fill Mode | 2212 | @subsection Auto Fill in Fortran Mode |
| 2208 | 2213 | ||
| 2209 | Fortran Auto Fill mode is a minor mode which automatically splits | 2214 | Fortran mode has specialized support for Auto Fill mode, which is a |
| 2210 | Fortran statements as you insert them when they become too wide. | 2215 | minor mode that automatically splits statements as you insert them when |
| 2211 | Splitting a statement involves making continuation lines using | 2216 | they become too wide. Splitting a statement involves making |
| 2212 | @code{fortran-continuation-string} (@pxref{ForIndent Cont}). This | 2217 | continuation lines using @code{fortran-continuation-string} |
| 2213 | splitting happens when you type @key{SPC}, @key{RET}, or @key{TAB}, and | 2218 | (@pxref{ForIndent Cont}). This splitting happens when you type |
| 2214 | also in the Fortran indentation commands. | 2219 | @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran indentation |
| 2215 | 2220 | commands. You activate Auto Fill in Fortran mode in the normal way | |
| 2216 | @findex fortran-auto-fill-mode | 2221 | (@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 | 2222 | ||
| 2223 | @vindex fortran-break-before-delimiters | 2223 | @vindex fortran-break-before-delimiters |
| 2224 | Fortran Auto Fill mode breaks lines at spaces or delimiters when the | 2224 | 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}). | 2225 | 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{,}, | 2226 | delimiters (besides whitespace) that Auto Fill can break at are |
| 2227 | @samp{'}, @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, and @samp{)}. | 2227 | @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>}, |
| 2228 | The line break comes after the delimiter if the variable | 2228 | and @samp{,}. The line break comes after the delimiter if the |
| 2229 | @code{fortran-break-before-delimiters} is @code{nil}. Otherwise (and by | 2229 | variable @code{fortran-break-before-delimiters} is @code{nil}. |
| 2230 | default), the break comes before the delimiter. | 2230 | Otherwise (and by default), the break comes before the delimiter. |
| 2231 | 2231 | ||
| 2232 | To enable this mode permanently, add a hook function to | 2232 | To enable Auto Fill in all Fortran buffers, add |
| 2233 | @code{fortran-mode-hook} to execute @code{(fortran-auto-fill-mode 1)}. | 2233 | @code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks}. |
| 2234 | @xref{Hooks}. | ||
| 2235 | 2234 | ||
| 2236 | @node Fortran Columns | 2235 | @node Fortran Columns |
| 2237 | @subsection Checking Columns in Fortran | 2236 | @subsection Checking Columns in Fortran |
| @@ -2280,7 +2279,7 @@ display. | |||
| 2280 | @findex fortran-window-create-momentarily | 2279 | @findex fortran-window-create-momentarily |
| 2281 | @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily | 2280 | @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily |
| 2282 | splits the current window horizontally, making a window 72 columns | 2281 | 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 | 2282 | wide, so you can see any lines that are too long. Type a space to |
| 2284 | restore the normal width. | 2283 | restore the normal width. |
| 2285 | 2284 | ||
| 2286 | @kindex C-u C-c C-w @r{(Fortran mode)} | 2285 | @kindex C-u C-c C-w @r{(Fortran mode)} |