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