fortran-mode

fortran-mode is an interactive compiled Lisp function in `fortran.el'.


(fortran-mode)

Parent mode: `prog-mode'.

Major mode for editing Fortran code in fixed format.
For free format code, use `f90-mode'.

M-x fortran-indent-line indents the current Fortran line correctly.
Note that DO statements must not share a common CONTINUE.

Type ;? or ;C-h to display a list of built-in abbrevs for Fortran keywords.

Key definitions:
key binding
--- -------

C-c Prefix Command
ESC Prefix Command
0 .. 9 fortran-electric-line-number
; fortran-abbrev-start

C-M-j fortran-split-line
C-M-n fortran-end-of-block
C-M-p fortran-beginning-of-block
C-M-q fortran-indent-subprogram
M-^ fortran-join-line

C-c C-d fortran-join-line
C-c C-n fortran-next-statement
C-c C-p fortran-previous-statement
C-c C-r fortran-column-ruler
C-c C-w fortran-window-create-momentarily
C-c ; fortran-comment-region



Variables controlling indentation style and extra features:

`fortran-comment-line-start'
To use comments starting with `!', set this to the string "!".
`fortran-do-indent'
Extra indentation within DO blocks (default 3).
`fortran-if-indent'
Extra indentation within IF blocks (default 3).
`fortran-structure-indent'
Extra indentation within STRUCTURE, UNION, MAP and INTERFACE blocks.
(default 3)
`fortran-continuation-indent'
Extra indentation applied to continuation statements (default 5).
`fortran-comment-line-extra-indent'
Amount of extra indentation for text in full-line comments (default 0).
`fortran-comment-indent-style'
How to indent the text in full-line comments. Allowed values are:
nil don't change the indentation
fixed indent to `fortran-comment-line-extra-indent' beyond the
value of either
`fortran-minimum-statement-indent-fixed' (fixed format) or
`fortran-minimum-statement-indent-tab' (TAB format),
depending on the continuation format in use.
relative indent to `fortran-comment-line-extra-indent' beyond the
indentation for a line of code.
(default 'fixed)
`fortran-comment-indent-char'
Single-character string to be inserted instead of space for
full-line comment indentation (default " ").
`fortran-minimum-statement-indent-fixed'
Minimum indentation for statements in fixed format mode (default 6).
`fortran-minimum-statement-indent-tab'
Minimum indentation for statements in TAB format mode (default 9).
`fortran-line-number-indent'
Maximum indentation for line numbers (default 1). A line number will
get less than this much indentation if necessary to avoid reaching
column 5.
`fortran-check-all-num-for-matching-do'
Non-nil causes all numbered lines to be treated as possible "continue"
statements (default nil).
`fortran-blink-matching-if'
Non-nil causes M-x fortran-indent-line on an ENDIF (or ENDDO) statement
to blink on the matching IF (or DO [WHILE]). (default nil)
`fortran-continuation-string'
Single-character string to be inserted in column 5 of a continuation
line (default "$").
`fortran-comment-region'
String inserted by M-x fortran-comment-region at start of each line in
the region (default "c$$$").
`fortran-electric-line-number'
Non-nil causes line number digits to be moved to the correct column
as typed (default t).
`fortran-break-before-delimiters'
Non-nil causes lines to be broken before delimiters (default t).

Turning on Fortran mode calls the value of the variable `fortran-mode-hook'
with no args, if that value is non-nil.