annotate man/fortran-xtra.texi @ 73079:b2a5b94a29c7

Fixed "Manheimer's icomplete patch"
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 23 Sep 2006 18:40:03 +0000
parents c7e4f78b81a6
children 3d45362f1d38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70457
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
1 @c This is part of the Emacs manual.
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
2 @c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
3 @c See file emacs.texi for copying conditions.
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
4 @c
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5 @c This file is included either in emacs-xtra.texi (when producing the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6 @c printed version) or in the main Emacs manual (for the on-line version).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
7 @node Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
8 @section Fortran Mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
9 @cindex Fortran mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
10 @cindex mode, Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
11
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
12 Fortran mode provides special motion commands for Fortran statements
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
13 and subprograms, and indentation commands that understand Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
14 conventions of nesting, line numbers and continuation statements.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
15 Fortran mode has support for Auto Fill mode that breaks long lines into
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
16 proper Fortran continuation lines.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
17
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
18 Special commands for comments are provided because Fortran comments
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
19 are unlike those of other languages. Built-in abbrevs optionally save
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
20 typing when you insert Fortran keywords.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
21
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
22 Use @kbd{M-x fortran-mode} to switch to this major mode. This
70464
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
23 command runs the hook @code{fortran-mode-hook}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
24 @iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
25 @xref{Hooks,,, emacs, the Emacs Manual}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
26 @end iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
27 @ifnottex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
28 @xref{Hooks}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
29 @end ifnottex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
30
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
31 @cindex Fortran77 and Fortran90
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
32 @findex f90-mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
33 @findex fortran-mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
34 Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
35 ``tab format'') source code. For editing the modern Fortran90 or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
36 Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
37 Emacs normally uses Fortran mode for files with extension @samp{.f},
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
38 @samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
39 @samp{.f95}. GNU Fortran supports both kinds of format.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
40
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
41 @menu
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
42 * Motion: Fortran Motion. Moving point by statements or subprograms.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
43 * Indent: Fortran Indent. Indentation commands for Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
44 * Comments: Fortran Comments. Inserting and aligning comments.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
45 * Autofill: Fortran Autofill. Auto fill support for Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
46 * Columns: Fortran Columns. Measuring columns for valid Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
47 * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
48 @end menu
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
49
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
50 @node Fortran Motion
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
51 @subsection Motion Commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
52
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
53 In addition to the normal commands for moving by and operating on
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
54 ``defuns'' (Fortran subprograms---functions and subroutines, as well as
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
55 modules for F90 mode), Fortran mode provides special commands to move by
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
56 statements and other program units.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
57
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
58 @table @kbd
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
59 @kindex C-c C-n @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
60 @findex fortran-next-statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
61 @findex f90-next-statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
62 @item C-c C-n
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
63 Move to the beginning of the next statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
64 (@code{fortran-next-statement}/@code{f90-next-statement}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
65
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
66 @kindex C-c C-p @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
67 @findex fortran-previous-statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
68 @findex f90-previous-statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
69 @item C-c C-p
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
70 Move to the beginning of the previous statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
71 (@code{fortran-previous-statement}/@code{f90-previous-statement}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
72 If there is no previous statement (i.e. if called from the first
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
73 statement in the buffer), move to the start of the buffer.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
74
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
75 @kindex C-c C-e @r{(F90 mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
76 @findex f90-next-block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
77 @item C-c C-e
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
78 Move point forward to the start of the next code block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
79 (@code{f90-next-block}). A code block is a subroutine,
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
80 @code{if}--@code{endif} statement, and so forth. This command exists
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
81 for F90 mode only, not Fortran mode. With a numeric argument, this
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
82 moves forward that many blocks.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
83
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
84 @kindex C-c C-a @r{(F90 mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
85 @findex f90-previous-block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
86 @item C-c C-a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
87 Move point backward to the previous code block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
88 (@code{f90-previous-block}). This is like @code{f90-next-block}, but
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
89 moves backwards.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
90
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
91 @kindex C-M-n @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
92 @findex fortran-end-of-block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
93 @findex f90-end-of-block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
94 @item C-M-n
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
95 Move to the end of the current code block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
96 (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric
70485
e41cc24662e3 Fix spelling errors.
Eli Zaretskii <eliz@gnu.org>
parents: 70464
diff changeset
97 argument, move forward that number of blocks. The mark is set before
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
98 moving point. The F90 mode version of this command checks for
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
99 consistency of block types and labels (if present), but it does not
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
100 check the outermost block since that may be incomplete.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
101
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
102 @kindex C-M-p @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
103 @findex fortran-beginning-of-block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
104 @findex f90-beginning-of-block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
105 @item C-M-p
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
106 Move to the start of the current code block
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
107 (@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
108 is like @code{fortran-end-of-block}, but moves backwards.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
109 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
110
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
111 @node Fortran Indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
112 @subsection Fortran Indentation
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
113
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
114 Special commands and features are needed for indenting Fortran code in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
115 order to make sure various syntactic entities (line numbers, comment line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
116 indicators and continuation line flags) appear in the columns that are
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
117 required for standard, fixed (or tab) format Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
118
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
119 @menu
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
120 * Commands: ForIndent Commands. Commands for indenting and filling Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
121 * Contline: ForIndent Cont. How continuation lines indent.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
122 * Numbers: ForIndent Num. How line numbers auto-indent.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
123 * Conv: ForIndent Conv. Conventions you must obey to avoid trouble.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
124 * Vars: ForIndent Vars. Variables controlling Fortran indent style.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
125 @end menu
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
126
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
127 @node ForIndent Commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
128 @subsubsection Fortran Indentation and Filling Commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
129
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
130 @table @kbd
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
131 @item C-M-j
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
132 Break the current line at point and set up a continuation line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
133 (@code{fortran-split-line}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
134 @item M-^
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
135 Join this line to the previous line (@code{fortran-join-line}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
136 @item C-M-q
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
137 Indent all the lines of the subprogram point is in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
138 (@code{fortran-indent-subprogram}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
139 @item M-q
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
140 Fill a comment block or statement.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
141 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
142
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
143 @kindex C-M-q @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
144 @findex fortran-indent-subprogram
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
145 The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
146 to reindent all the lines of the Fortran subprogram (function or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
147 subroutine) containing point.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
148
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
149 @kindex C-M-j @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
150 @findex fortran-split-line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
151 The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
152 a line in the appropriate fashion for Fortran. In a non-comment line,
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
153 the second half becomes a continuation line and is indented
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
154 accordingly. In a comment line, both halves become separate comment
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
155 lines.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
156
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
157 @kindex M-^ @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
158 @kindex C-c C-d @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
159 @findex fortran-join-line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
160 @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
161 which joins a continuation line back to the previous line, roughly as
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
162 the inverse of @code{fortran-split-line}. The point must be on a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
163 continuation line when this command is invoked.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
164
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
165 @kindex M-q @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
166 @kbd{M-q} in Fortran mode fills the comment block or statement that
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
167 point is in. This removes any excess statement continuations.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
168
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
169 @node ForIndent Cont
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
170 @subsubsection Continuation Lines
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
171 @cindex Fortran continuation lines
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
172
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
173 @vindex fortran-continuation-string
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
174 Most Fortran77 compilers allow two ways of writing continuation lines.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
175 If the first non-space character on a line is in column 5, then that
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
176 line is a continuation of the previous line. We call this @dfn{fixed
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
177 format}. (In GNU Emacs we always count columns from 0; but note that
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
178 the Fortran standard counts from 1.) The variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
179 @code{fortran-continuation-string} specifies what character to put in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
180 column 5. A line that starts with a tab character followed by any digit
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
181 except @samp{0} is also a continuation line. We call this style of
72101
c7e4f78b81a6 Move periods and commas inside quotes.
Richard M. Stallman <rms@gnu.org>
parents: 70485
diff changeset
182 continuation @dfn{tab format}. (Fortran90 introduced ``free format,''
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
183 with another style of continuation lines).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
184
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
185 @vindex indent-tabs-mode @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
186 @vindex fortran-analyze-depth
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
187 @vindex fortran-tab-mode-default
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
188 Fortran mode can use either style of continuation line. When you
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
189 enter Fortran mode, it tries to deduce the proper continuation style
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
190 automatically from the buffer contents. It does this by scanning up to
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
191 @code{fortran-analyze-depth} (default 100) lines from the start of the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
192 buffer. The first line that begins with either a tab character or six
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
193 spaces determines the choice. If the scan fails (for example, if the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
194 buffer is new and therefore empty), the value of
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
195 @code{fortran-tab-mode-default} (@code{nil} for fixed format, and
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
196 non-@code{nil} for tab format) is used. @samp{/t} in the mode line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
197 indicates tab format is selected. Fortran mode sets the value of
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
198 @code{indent-tabs-mode} accordingly.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
199
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
200 If the text on a line starts with the Fortran continuation marker
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
201 @samp{$}, or if it begins with any non-whitespace character in column
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
202 5, Fortran mode treats it as a continuation line. When you indent a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
203 continuation line with @key{TAB}, it converts the line to the current
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
204 continuation style. When you split a Fortran statement with
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
205 @kbd{C-M-j}, the continuation marker on the newline is created according
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
206 to the continuation style.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
207
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
208 The setting of continuation style affects several other aspects of
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
209 editing in Fortran mode. In fixed format mode, the minimum column
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
210 number for the body of a statement is 6. Lines inside of Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
211 blocks that are indented to larger column numbers always use only the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
212 space character for whitespace. In tab format mode, the minimum
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
213 column number for the statement body is 8, and the whitespace before
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
214 column 8 must always consist of one tab character.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
215
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
216 @node ForIndent Num
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
217 @subsubsection Line Numbers
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
218
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
219 If a number is the first non-whitespace in the line, Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
220 indentation assumes it is a line number and moves it to columns 0
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
221 through 4. (Columns always count from 0 in GNU Emacs.)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
222
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
223 @vindex fortran-line-number-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
224 Line numbers of four digits or less are normally indented one space.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
225 The variable @code{fortran-line-number-indent} controls this; it
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
226 specifies the maximum indentation a line number can have. The default
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
227 value of the variable is 1. Fortran mode tries to prevent line number
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
228 digits passing column 4, reducing the indentation below the specified
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
229 maximum if necessary. If @code{fortran-line-number-indent} has the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
230 value 5, line numbers are right-justified to end in column 4.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
231
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
232 @vindex fortran-electric-line-number
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
233 Simply inserting a line number is enough to indent it according to
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
234 these rules. As each digit is inserted, the indentation is recomputed.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
235 To turn off this feature, set the variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
236 @code{fortran-electric-line-number} to @code{nil}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
237
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
238
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
239 @node ForIndent Conv
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
240 @subsubsection Syntactic Conventions
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
241
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
242 Fortran mode assumes that you follow certain conventions that simplify
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
243 the task of understanding a Fortran program well enough to indent it
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
244 properly:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
245
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
246 @itemize @bullet
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
247 @item
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
248 Two nested @samp{do} loops never share a @samp{continue} statement.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
249
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
250 @item
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
251 Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
252 and others are written without embedded whitespace or line breaks.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
253
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
254 Fortran compilers generally ignore whitespace outside of string
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
255 constants, but Fortran mode does not recognize these keywords if they
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
256 are not contiguous. Constructs such as @samp{else if} or @samp{end do}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
257 are acceptable, but the second word should be on the same line as the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
258 first and not on a continuation line.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
259 @end itemize
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
260
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
261 @noindent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
262 If you fail to follow these conventions, the indentation commands may
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
263 indent some lines unaesthetically. However, a correct Fortran program
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
264 retains its meaning when reindented even if the conventions are not
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
265 followed.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
266
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
267 @node ForIndent Vars
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
268 @subsubsection Variables for Fortran Indentation
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
269
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
270 @vindex fortran-do-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
271 @vindex fortran-if-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
272 @vindex fortran-structure-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
273 @vindex fortran-continuation-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
274 @vindex fortran-check-all-num@dots{}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
275 @vindex fortran-minimum-statement-indent@dots{}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
276 Several additional variables control how Fortran indentation works:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
277
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
278 @table @code
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
279 @item fortran-do-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
280 Extra indentation within each level of @samp{do} statement (default 3).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
281
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
282 @item fortran-if-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
283 Extra indentation within each level of @samp{if}, @samp{select case}, or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
284 @samp{where} statements (default 3).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
285
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
286 @item fortran-structure-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
287 Extra indentation within each level of @samp{structure}, @samp{union},
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
288 @samp{map}, or @samp{interface} statements (default 3).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
289
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
290 @item fortran-continuation-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
291 Extra indentation for bodies of continuation lines (default 5).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
292
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
293 @item fortran-check-all-num-for-matching-do
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
294 In Fortran77, a numbered @samp{do} statement is ended by any statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
295 with a matching line number. It is common (but not compulsory) to use a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
296 @samp{continue} statement for this purpose. If this variable has a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
297 non-@code{nil} value, indenting any numbered statement must check for a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
298 @samp{do} that ends there. If you always end @samp{do} statements with
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
299 a @samp{continue} line (or if you use the more modern @samp{enddo}),
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
300 then you can speed up indentation by setting this variable to
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
301 @code{nil}. The default is @code{nil}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
302
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
303 @item fortran-blink-matching-if
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
304 If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
305 statement moves the cursor momentarily to the matching @samp{if} (or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
306 @samp{do}) statement to show where it is. The default is @code{nil}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
307
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
308 @item fortran-minimum-statement-indent-fixed
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
309 Minimum indentation for Fortran statements when using fixed format
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
310 continuation line style. Statement bodies are never indented less than
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
311 this much. The default is 6.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
312
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
313 @item fortran-minimum-statement-indent-tab
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
314 Minimum indentation for Fortran statements for tab format continuation line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
315 style. Statement bodies are never indented less than this much. The
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
316 default is 8.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
317 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
318
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
319 The variables controlling the indentation of comments are described in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
320 the following section.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
321
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
322 @node Fortran Comments
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
323 @subsection Fortran Comments
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
324
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
325 The usual Emacs comment commands assume that a comment can follow a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
326 line of code. In Fortran77, the standard comment syntax requires an
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
327 entire line to be just a comment. Therefore, Fortran mode replaces the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
328 standard Emacs comment commands and defines some new variables.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
329
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
330 @vindex fortran-comment-line-start
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
331 Fortran mode can also handle the Fortran90 comment syntax where comments
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
332 start with @samp{!} and can follow other text. Because only some Fortran77
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
333 compilers accept this syntax, Fortran mode will not insert such comments
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
334 unless you have said in advance to do so. To do this, set the variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
335 @code{fortran-comment-line-start} to @samp{"!"}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
336
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
337 @table @kbd
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
338 @item M-;
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
339 Align comment or insert new comment (@code{fortran-indent-comment}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
340
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
341 @item C-x ;
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
342 Applies to nonstandard @samp{!} comments only.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
343
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
344 @item C-c ;
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
345 Turn all lines of the region into comments, or (with argument) turn them back
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
346 into real code (@code{fortran-comment-region}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
347 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
348
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
349 @findex fortran-indent-comment
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
350 @kbd{M-;} in Fortran mode is redefined as the command
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
351 @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
352 recognizes any kind of existing comment and aligns its text appropriately;
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
353 if there is no existing comment, a comment is inserted and aligned. But
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
354 inserting and aligning comments are not the same in Fortran mode as in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
355 other modes.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
356
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
357 When a new comment must be inserted, if the current line is blank, a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
358 full-line comment is inserted. On a non-blank line, a nonstandard @samp{!}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
359 comment is inserted if you have said you want to use them. Otherwise a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
360 full-line comment is inserted on a new line before the current line.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
361
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
362 Nonstandard @samp{!} comments are aligned like comments in other
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
363 languages, but full-line comments are different. In a standard full-line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
364 comment, the comment delimiter itself must always appear in column zero.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
365 What can be aligned is the text within the comment. You can choose from
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
366 three styles of alignment by setting the variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
367 @code{fortran-comment-indent-style} to one of these values:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
368
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
369 @vindex fortran-comment-indent-style
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
370 @vindex fortran-comment-line-extra-indent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
371 @table @code
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
372 @item fixed
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
373 Align the text at a fixed column, which is the sum of
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
374 @code{fortran-comment-line-extra-indent} and the minimum statement
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
375 indentation. This is the default.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
376
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
377 The minimum statement indentation is
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
378 @code{fortran-minimum-statement-indent-fixed} for fixed format
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
379 continuation line style and @code{fortran-minimum-statement-indent-tab}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
380 for tab format style.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
381
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
382 @item relative
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
383 Align the text as if it were a line of code, but with an additional
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
384 @code{fortran-comment-line-extra-indent} columns of indentation.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
385
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
386 @item nil
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
387 Don't move text in full-line comments automatically.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
388 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
389
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
390 @vindex fortran-comment-indent-char
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
391 In addition, you can specify the character to be used to indent within
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
392 full-line comments by setting the variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
393 @code{fortran-comment-indent-char} to the single-character string you want
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
394 to use.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
395
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
396 @vindex fortran-directive-re
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
397 Compiler directive lines, or preprocessor lines, have much the same
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
398 appearance as comment lines. It is important, though, that such lines
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
399 never be indented at all, no matter what the value of
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
400 @code{fortran-comment-indent-style}. The variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
401 @code{fortran-directive-re} is a regular expression that specifies which
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
402 lines are directives. Matching lines are never indented, and receive
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
403 distinctive font-locking.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
404
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
405 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
406 you use @samp{!} comments, this command can be used with them. Otherwise
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
407 it is useless in Fortran mode.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
408
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
409 @kindex C-c ; @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
410 @findex fortran-comment-region
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
411 @vindex fortran-comment-region
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
412 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
413 lines of the region into comments by inserting the string @samp{C$$$} at
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
414 the front of each one. With a numeric argument, it turns the region
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
415 back into live code by deleting @samp{C$$$} from the front of each line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
416 in it. The string used for these comments can be controlled by setting
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
417 the variable @code{fortran-comment-region}. Note that here we have an
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
418 example of a command and a variable with the same name; these two uses
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
419 of the name never conflict because in Lisp and in Emacs it is always
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
420 clear from the context which one is meant.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
421
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
422 @node Fortran Autofill
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
423 @subsection Auto Fill in Fortran Mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
424
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
425 Fortran mode has specialized support for Auto Fill mode, which is a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
426 minor mode that automatically splits statements as you insert them
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
427 when they become too wide. Splitting a statement involves making
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
428 continuation lines using @code{fortran-continuation-string}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
429 (@pxref{ForIndent Cont}). This splitting happens when you type
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
430 @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
431 indentation commands. You activate Auto Fill in Fortran mode in the
70464
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
432 normal way.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
433 @iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
434 @xref{Auto Fill,,, emacs, the Emacs Manual}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
435 @end iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
436 @ifnottex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
437 @xref{Auto Fill}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
438 @end ifnottex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
439
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
440 @vindex fortran-break-before-delimiters
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
441 Auto Fill breaks lines at spaces or delimiters when the lines get
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
442 longer than the desired width (the value of @code{fill-column}). The
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
443 delimiters (besides whitespace) that Auto Fill can break at are
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
444 @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
445 and @samp{,}. The line break comes after the delimiter if the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
446 variable @code{fortran-break-before-delimiters} is @code{nil}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
447 Otherwise (and by default), the break comes before the delimiter.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
448
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
449 To enable Auto Fill in all Fortran buffers, add
70464
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
450 @code{turn-on-auto-fill} to @code{fortran-mode-hook}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
451 @iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
452 @xref{Hooks,,, emacs, the Emacs Manual}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
453 @end iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
454 @ifnottex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
455 @xref{Hooks}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
456 @end ifnottex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
457
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
458 @node Fortran Columns
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
459 @subsection Checking Columns in Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
460
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
461 @table @kbd
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
462 @item C-c C-r
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
463 Display a ``column ruler'' momentarily above the current line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
464 (@code{fortran-column-ruler}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
465 @item C-c C-w
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
466 Split the current window horizontally temporarily so that it is 72
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
467 columns wide (@code{fortran-window-create-momentarily}). This may
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
468 help you avoid making lines longer than the 72-character limit that
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
469 some Fortran compilers impose.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
470 @item C-u C-c C-w
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
471 Split the current window horizontally so that it is 72 columns wide
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
472 (@code{fortran-window-create}). You can then continue editing.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
473 @item M-x fortran-strip-sequence-nos
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
474 Delete all text in column 72 and beyond.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
475 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
476
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
477 @kindex C-c C-r @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
478 @findex fortran-column-ruler
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
479 The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
480 ruler momentarily above the current line. The comment ruler is two lines
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
481 of text that show you the locations of columns with special significance in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
482 Fortran programs. Square brackets show the limits of the columns for line
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
483 numbers, and curly brackets show the limits of the columns for the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
484 statement body. Column numbers appear above them.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
485
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
486 Note that the column numbers count from zero, as always in GNU Emacs.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
487 As a result, the numbers may be one less than those you are familiar
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
488 with; but the positions they indicate in the line are standard for
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
489 Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
490
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
491 @vindex fortran-column-ruler-fixed
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
492 @vindex fortran-column-ruler-tabs
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
493 The text used to display the column ruler depends on the value of the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
494 variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
495 @code{nil}, then the value of the variable
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
496 @code{fortran-column-ruler-fixed} is used as the column ruler.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
497 Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
498 displayed. By changing these variables, you can change the column ruler
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
499 display.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
500
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
501 @kindex C-c C-w @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
502 @findex fortran-window-create-momentarily
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
503 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
504 splits the current window horizontally, making a window 72 columns
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
505 wide, so you can see any lines that are too long. Type a space to
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
506 restore the normal width.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
507
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
508 @kindex C-u C-c C-w @r{(Fortran mode)}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
509 @findex fortran-window-create
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
510 You can also split the window horizontally and continue editing with
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
511 the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
512 fortran-window-create}). By editing in this window you can
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
513 immediately see when you make a line too wide to be correct Fortran.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
514
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
515 @findex fortran-strip-sequence-nos
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
516 The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
517 column 72 and beyond, on all lines in the current buffer. This is the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
518 easiest way to get rid of old sequence numbers.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
519
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
520 @node Fortran Abbrev
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
521 @subsection Fortran Keyword Abbrevs
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
522
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
523 Fortran mode provides many built-in abbrevs for common keywords and
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
524 declarations. These are the same sort of abbrev that you can define
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
525 yourself. To use them, you must turn on Abbrev mode.
70464
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
526 @iftex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
527 @xref{Abbrevs,,, emacs, the Emacs Manual}.
70464
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
528 @end iftex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
529 @ifnottex
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
530 @xref{Abbrevs}.
35a93621d68f (Fortran, Fortran Autofill)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
531 @end ifnottex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
532
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
533 The built-in abbrevs are unusual in one way: they all start with a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
534 semicolon. You cannot normally use semicolon in an abbrev, but Fortran
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
535 mode makes this possible by changing the syntax of semicolon to ``word
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
536 constituent.''
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
537
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
538 For example, one built-in Fortran abbrev is @samp{;c} for
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
539 @samp{continue}. If you insert @samp{;c} and then insert a punctuation
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
540 character such as a space or a newline, the @samp{;c} expands automatically
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
541 to @samp{continue}, provided Abbrev mode is enabled.@refill
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
542
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
543 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
544 Fortran abbrevs and what they stand for.
70461
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
545
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
546 @ignore
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
547 arch-tag: 23ed7c36-1517-4646-9235-2d5ade5f06f6
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
548 @end ignore