1 01/31/79 Multics EMACS Fortran mode. Paul Schauble
2 DVCP M.S. C34
3 602-866-4531
4
5 **This file is intended to be perused via dprint, print, or via an**
6 **editor. It is not intended to be perused with the help command **
7
8
9
10
11 ^L
12 This is the second edition of EMACS Fortran mode. This
13 mode is intended to aid in the construction and debugging of
14 Fortran programs using EMACS. Commands are provided for
15 producing comment and continuation cards and for other commonly
16 used formatting operations.
17
18 Fortran major mode is entered via the following command:
19
20 ESC-X fortran-mode CR
21
22 This mode may also be entered by Find File'ing any file
23 with a last component name of ".fortran" when the
24 find-file-set-modes option is selected.
25
26 The current list of special commands in Fortran mode is:
27
28 CR Carriage Return has been changed so that the cursor will
29 return to column 7, rather than to column 1. This will
30 also insert comment prefixes "c " in the appropriate
31 places. If desired, the cursor may be moved back by hand
32 to delete spaces or comment prefixes.
33
34 ^I Tab has been changed so that a tab done in column 1 will
35 tab to column 7. Subsequent tabs will tab to the normal
36 places. The sequence for successive tabs is 7,10,20,30...
37
38 ESC-^M Or ESC-CR ends the current line when the next line is a
39 continuation. A new line will be done, unless the current
40 line is blank or empty, and the prefix " & " will be
41 inserted, leaving the cursor in column 9. This is the
42 continuation for standard Fortran rather than for
43 Multics.
44
45 ESC-; Begins a single comment line. A new line is done, unless
46 the current line is blank or empty, and the prefix
47 "c " inserted, leaving the cursor in column 7. This
48 may be used to end a line when the next line is a comment.
49
50 ^XC Begins a block of comments. The current line, if any, will
51 be ended and a comment block header line inserted. Any
52 future lines added will be prefixed by the standard
53 comment prefix "c ". This minor mode is exited by a
54 second ^XC. Notice that ^X^C exits the editor. Don't miss!
55
56 ESC-: Positions a fortran label. Since a line usually starts in
57 column 7, this command is provided to correctly position
58 statement numbers. Type the statement number, then ESC-:
59 to place the label in column 1.
60
61 ESC-^C Compile program. The current buffer, if changed, is written
62 out to its default pathname as for ^X^S, and then
63 compiled. Compiler diagnostics are displayed, in the other
64 window if in two-window mode. The extended commands
65 set-compiler and set-compile-options may be used to select
66 the compiler and options to be used.
67
68 ^X^D Find next error. This command is used following a
69 compilation in two-window mode. It scans the compiler output
70 and the source buffer in parallel, pointing a simulated
71 cursor to consecutive errors and placing the real cursor on
72 the line referred to in the error message. This mode will
73 terminate itself when you advance past the last error, when
74 you do another compilation, or when you exit it by keying
75 ^XT. Since this mode locks the buffer used for
76 compilations, you are strongly advised to exit it when you
77 are finished.
78
79 ' Abbreviation expander. The two characters immediately
80 preceeding the cursor when this character is struck
81 are taken as an abbreviation and expanded. The
82 character ' may itself be inserted by quoting it with
83 \ or ^Q. These abbreviations are initially supplied:
84 in integer su subroutine
85 di dimension co continue
86 fu function re return
87 eq equivalence ex external
88 au automatic cn common
89 fo format im implicit
90 Note that, with the exception of cn for common, all of
91 these abbreviations are the first two characters of
92 the word. Other abbreviations may be defined using the
93 extended command set-fortran-abbrev.
94 The abbreviations co continue and re return are very
95 special. Since these words almost always have a label
96 and sit on a line by themselves, these abbreviations have
97 been hacked to do an ESC-: and a new-line, so that
98 typing in column 7
99 123co'
100 will expand to
101 123 continue
102 leaving you on the next line. The abbrev fo for format
103 hacks labels, but not new lines. Try them.
104
105 In addition, several extended commands have been provided to set
106 various parameters. These are:
107
108 For comment blocks:
109 ESC-X fortran-set-begin-comment CR to set the begin line, and
110 ESC-X fortran-set-end-comment CR to set the end line.
111
112 Both of these commands prompt for the line in the minibuffer.
113 The line supplied is inserted exactly as given, and must therefore
114 include the "c" at the beginning. Default values for these lines are
115 "c ========================================".
116 These are set by buffer.
117
118 For compilations:
119 ESC-X set-compiler compiler-name CR
120 to set the compiler to be used. Default is "ft".
121 ESC-X set-compile-options options CR
122 to set compile options. These are given as on the
123 compiler command. The default is "-tb". These are
124 set by buffer.
125
126 And, for abbreviations,
127 ESC-X set-fortran-abbrev abbrev expansion label eol
128 may be used to define new abbreviations. abbrev must
129 be a two character abbreviation that will be replaced
130 with expansion. Arguments must be enclosed in quotes
131 if they contain special characters, including spaces.
132 The optional arguments label and eol will cause this
133 abbrev to hack labels and new lines, respectively, just
134 like co and re. The label option does not require a
135 label, but processes it if it is present.
136 Abbreviations are defined globaly and apply to all
137 buffers in fortran mode. For example,
138 ESC-X set-fortran-abbrev as "common /xyz/ y100" eol
139 defines an abbrev as that expands to
140 common /xyz/ y100
141 and does a new-line, but does not believe in labels.
142
143
144 As mentioned above, this is an early edition and there may
145 still be problems. Any difficulties, comments, suggestions, etc.
146 may be mailed to Schauble.fso on System M Phoenix for action.
147 MIT-Multics and other ARPANET users continue to send bug/comment
148 mail to emacs.bugs at MIT-Multics as usual they will be forwarded.
149 In fact, I would like to know if anyone is using this thing.
150
151 Intended for future implementation are:
152
153 Debugging mode - Fortran debugging using probe integrated with
154 the editor. For now, the recommended debugging method
155 is to do a ^Z and run your program one level up.
156 Return to emacs with a pi command.
157
158
159 Any suggestions on these or other features should be mailed to
160 the above address.
161