Mercurial > emacs
annotate man/fortran-xtra.texi @ 70441:8c4614d0bcda
(Text): Replace inforef to emacs-xtra by conditional xref's, depending on
@iftex/@ifnottex.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 06 May 2006 12:46:56 +0000 |
parents | 5e1c038e4afa |
children | bdd0ac985d67 |
rev | line source |
---|---|
70440
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
1 @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
|
2 @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
|
3 @node Fortran |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
4 @section Fortran Mode |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
5 @cindex Fortran mode |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
6 @cindex mode, Fortran |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
7 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
8 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
|
9 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
|
10 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
|
11 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
|
12 proper Fortran continuation lines. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
13 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
14 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
|
15 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
|
16 typing when you insert Fortran keywords. |
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 Use @kbd{M-x fortran-mode} to switch to this major mode. This |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
19 command runs the hook @code{fortran-mode-hook}. @xref{Hooks,,, emacs, |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
20 the Emacs Manual}. |
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 @cindex Fortran77 and Fortran90 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
23 @findex f90-mode |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
24 @findex fortran-mode |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
25 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
|
26 ``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
|
27 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
|
28 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
|
29 @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
|
30 @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
|
31 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
32 @menu |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
33 * 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
|
34 * Indent: Fortran Indent. Indentation commands for Fortran. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
35 * Comments: Fortran Comments. Inserting and aligning comments. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
36 * 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
|
37 * 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
|
38 * 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
|
39 @end menu |
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 @node Fortran Motion |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
42 @subsection Motion Commands |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
43 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
44 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
|
45 ``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
|
46 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
|
47 statements and other program units. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
48 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
49 @table @kbd |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
50 @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
|
51 @findex fortran-next-statement |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
52 @findex f90-next-statement |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
53 @item C-c C-n |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
54 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
|
55 (@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
|
56 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
57 @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
|
58 @findex fortran-previous-statement |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
59 @findex f90-previous-statement |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
60 @item C-c C-p |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
61 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
|
62 (@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
|
63 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
|
64 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
|
65 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
66 @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
|
67 @findex f90-next-block |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
68 @item C-c C-e |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
69 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
|
70 (@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
|
71 @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
|
72 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
|
73 moves forward that many blocks. |
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-a @r{(F90 mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
76 @findex f90-previous-block |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
77 @item C-c C-a |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
78 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
|
79 (@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
|
80 moves backwards. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
81 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
82 @kindex C-M-n @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
83 @findex fortran-end-of-block |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
84 @findex f90-end-of-block |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
85 @item C-M-n |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
86 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
|
87 (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
88 agument, move forward that number of blocks. The mark is set before |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
89 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
|
90 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
|
91 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
|
92 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
93 @kindex C-M-p @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
94 @findex fortran-beginning-of-block |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
95 @findex f90-beginning-of-block |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
96 @item C-M-p |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
97 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
|
98 (@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
|
99 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
|
100 @end table |
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 @node Fortran Indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
103 @subsection Fortran Indentation |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
104 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
105 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
|
106 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
|
107 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
|
108 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
|
109 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
110 @menu |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
111 * 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
|
112 * Contline: ForIndent Cont. How continuation lines indent. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
113 * 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
|
114 * 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
|
115 * 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
|
116 @end menu |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
117 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
118 @node ForIndent Commands |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
119 @subsubsection Fortran Indentation and Filling Commands |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
120 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
121 @table @kbd |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
122 @item C-M-j |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
123 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
|
124 (@code{fortran-split-line}). |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
125 @item M-^ |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
126 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
|
127 @item C-M-q |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
128 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
|
129 (@code{fortran-indent-subprogram}). |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
130 @item M-q |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
131 Fill a comment block or statement. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
132 @end table |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
133 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
134 @kindex C-M-q @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
135 @findex fortran-indent-subprogram |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
136 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
|
137 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
|
138 subroutine) containing point. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
139 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
140 @kindex C-M-j @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
141 @findex fortran-split-line |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
142 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
|
143 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
|
144 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
|
145 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
|
146 lines. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
147 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
148 @kindex M-^ @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
149 @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
|
150 @findex fortran-join-line |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
151 @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
|
152 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
|
153 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
|
154 continuation line when this command is invoked. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
155 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
156 @kindex M-q @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
157 @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
|
158 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
|
159 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
160 @node ForIndent Cont |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
161 @subsubsection Continuation Lines |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
162 @cindex Fortran continuation lines |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
163 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
164 @vindex fortran-continuation-string |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
165 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
|
166 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
|
167 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
|
168 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
|
169 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
|
170 @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
|
171 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
|
172 except @samp{0} is also a continuation line. We call this style of |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
173 continuation @dfn{tab format}. (Fortran90 introduced ``free format'', |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
174 with another style of continuation lines). |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
175 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
176 @vindex indent-tabs-mode @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
177 @vindex fortran-analyze-depth |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
178 @vindex fortran-tab-mode-default |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
179 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
|
180 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
|
181 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
|
182 @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
|
183 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
|
184 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
|
185 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
|
186 @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
|
187 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
|
188 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
|
189 @code{indent-tabs-mode} accordingly. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
190 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
191 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
|
192 @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
|
193 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
|
194 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
|
195 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
|
196 @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
|
197 to the continuation style. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
198 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
199 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
|
200 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
|
201 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
|
202 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
|
203 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
|
204 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
|
205 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
|
206 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
207 @node ForIndent Num |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
208 @subsubsection Line Numbers |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
209 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
210 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
|
211 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
|
212 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
|
213 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
214 @vindex fortran-line-number-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
215 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
|
216 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
|
217 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
|
218 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
|
219 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
|
220 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
|
221 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
|
222 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
223 @vindex fortran-electric-line-number |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
224 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
|
225 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
|
226 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
|
227 @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
|
228 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
229 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
230 @node ForIndent Conv |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
231 @subsubsection Syntactic Conventions |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
232 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
233 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
|
234 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
|
235 properly: |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
236 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
237 @itemize @bullet |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
238 @item |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
239 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
|
240 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
241 @item |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
242 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
|
243 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
|
244 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
245 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
|
246 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
|
247 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
|
248 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
|
249 first and not on a continuation line. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
250 @end itemize |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
251 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
252 @noindent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
253 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
|
254 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
|
255 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
|
256 followed. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
257 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
258 @node ForIndent Vars |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
259 @subsubsection Variables for Fortran Indentation |
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 @vindex fortran-do-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
262 @vindex fortran-if-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
263 @vindex fortran-structure-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
264 @vindex fortran-continuation-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
265 @vindex fortran-check-all-num@dots{} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
266 @vindex fortran-minimum-statement-indent@dots{} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
267 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
|
268 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
269 @table @code |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
270 @item fortran-do-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
271 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
|
272 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
273 @item fortran-if-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
274 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
|
275 @samp{where} statements (default 3). |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
276 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
277 @item fortran-structure-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
278 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
|
279 @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
|
280 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
281 @item fortran-continuation-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
282 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
|
283 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
284 @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
|
285 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
|
286 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
|
287 @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
|
288 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
|
289 @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
|
290 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
|
291 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
|
292 @code{nil}. The default is @code{nil}. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
293 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
294 @item fortran-blink-matching-if |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
295 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
|
296 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
|
297 @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
|
298 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
299 @item fortran-minimum-statement-indent-fixed |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
300 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
|
301 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
|
302 this much. The default is 6. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
303 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
304 @item fortran-minimum-statement-indent-tab |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
305 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
|
306 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
|
307 default is 8. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
308 @end table |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
309 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
310 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
|
311 the following section. |
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 @node Fortran Comments |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
314 @subsection Fortran Comments |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
315 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
316 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
|
317 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
|
318 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
|
319 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
|
320 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
321 @vindex fortran-comment-line-start |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
322 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
|
323 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
|
324 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
|
325 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
|
326 @code{fortran-comment-line-start} to @samp{"!"}. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
327 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
328 @table @kbd |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
329 @item M-; |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
330 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
|
331 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
332 @item C-x ; |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
333 Applies to nonstandard @samp{!} comments only. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
334 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
335 @item C-c ; |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
336 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
|
337 into real code (@code{fortran-comment-region}). |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
338 @end table |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
339 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
340 @findex fortran-indent-comment |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
341 @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
|
342 @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
|
343 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
|
344 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
|
345 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
|
346 other modes. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
347 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
348 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
|
349 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
|
350 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
|
351 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
|
352 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
353 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
|
354 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
|
355 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
|
356 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
|
357 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
|
358 @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
|
359 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
360 @vindex fortran-comment-indent-style |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
361 @vindex fortran-comment-line-extra-indent |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
362 @table @code |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
363 @item fixed |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
364 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
|
365 @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
|
366 indentation. This is the default. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
367 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
368 The minimum statement indentation is |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
369 @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
|
370 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
|
371 for tab format style. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
372 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
373 @item relative |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
374 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
|
375 @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
|
376 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
377 @item nil |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
378 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
|
379 @end table |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
380 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
381 @vindex fortran-comment-indent-char |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
382 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
|
383 full-line comments by setting the variable |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
384 @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
|
385 to use. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
386 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
387 @vindex fortran-directive-re |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
388 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
|
389 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
|
390 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
|
391 @code{fortran-comment-indent-style}. The variable |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
392 @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
|
393 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
|
394 distinctive font-locking. |
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 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
|
397 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
|
398 it is useless in Fortran mode. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
399 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
400 @kindex C-c ; @r{(Fortran mode)} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
401 @findex fortran-comment-region |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
402 @vindex fortran-comment-region |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
403 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
|
404 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
|
405 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
|
406 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
|
407 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
|
408 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
|
409 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
|
410 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
|
411 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
|
412 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
413 @node Fortran Autofill |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
414 @subsection Auto Fill in Fortran Mode |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
415 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
416 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
|
417 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
|
418 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
|
419 continuation lines using @code{fortran-continuation-string} |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
420 (@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
|
421 @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
|
422 indentation commands. You activate Auto Fill in Fortran mode in the |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
423 normal way. @xref{Auto Fill,,, emacs, the Emacs Manual}. |
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 @vindex fortran-break-before-delimiters |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
426 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
|
427 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
|
428 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
|
429 @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>}, |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
430 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
|
431 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
|
432 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
|
433 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
434 To enable Auto Fill in all Fortran buffers, add |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
435 @code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks,,, |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
436 emacs, the Emacs Manual}. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
437 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
438 @node Fortran Columns |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
439 @subsection Checking Columns in Fortran |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
440 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
441 @table @kbd |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
442 @item C-c C-r |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
443 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
|
444 (@code{fortran-column-ruler}). |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
445 @item C-c C-w |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
446 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
|
447 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
|
448 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
|
449 some Fortran compilers impose. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
450 @item C-u C-c C-w |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
451 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
|
452 (@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
|
453 @item M-x fortran-strip-sequence-nos |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
454 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
|
455 @end table |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
456 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
457 @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
|
458 @findex fortran-column-ruler |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
459 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
|
460 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
|
461 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
|
462 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
|
463 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
|
464 statement body. Column numbers appear above them. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
465 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
466 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
|
467 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
|
468 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
|
469 Fortran. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
470 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
471 @vindex fortran-column-ruler-fixed |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
472 @vindex fortran-column-ruler-tabs |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
473 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
|
474 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
|
475 @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
|
476 @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
|
477 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
|
478 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
|
479 display. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
480 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
481 @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
|
482 @findex fortran-window-create-momentarily |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
483 @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
|
484 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
|
485 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
|
486 restore the normal width. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
487 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
488 @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
|
489 @findex fortran-window-create |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
490 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
|
491 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
|
492 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
|
493 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
|
494 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
495 @findex fortran-strip-sequence-nos |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
496 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
|
497 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
|
498 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
|
499 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
500 @node Fortran Abbrev |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
501 @subsection Fortran Keyword Abbrevs |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
502 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
503 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
|
504 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
|
505 yourself. To use them, you must turn on Abbrev mode. |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
506 @xref{Abbrevs,,, emacs, the Emacs Manual}. |
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 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
|
509 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
|
510 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
|
511 constituent.'' |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
512 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
513 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
|
514 @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
|
515 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
|
516 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
|
517 |
5e1c038e4afa
New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
518 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
|
519 Fortran abbrevs and what they stand for. |