f(9)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
SYNOPSIS
f, f77, f90 - Fortran files
FILES
hkf90.emf - Fortran hook definition
f90.etf - Fortran 90 template file.
f.etf - Fortran (77) template file.
f90.eaf - Fortran 90 abbreviation file.
EXTENSIONS
DESCRIPTION
The f90 file type templates provide simple hilighting of Fortran 77 and Fortran 90 files, the template provides minimal hilighting of both language syntaxes, which are overloaded into the same file.
The major difference between the file types, apart from the new reserved words, is the comments. In Fortran 90 comments are introduced with !, while the other types use a c in column 0.
General Editing
On creating a new file, a new header is automatically included into the file.
time(2m) is by default enabled, allowing the modification time-stamp to be maintained in the header.
Hilighting
The hilighting features allow functions, subroutines, variables, logical, comments, strings and characters of the language to be differentiated and rendered in different colors.
Auto Layout
Folding and Information Hiding
Generic folding is enabled within the f90 files. The folds occur about program, function or procedure keywords and their end text located on the left-hand margin.
collapse-all(3) (un)folds all regions in the file,
collapse-current(3) (un)folds the current region.
Navigation via Item List
The Fortran mode offers beside folding as well support for displaying an outline of the functions, subroutine and program definitions of the Fortran file for easy navigation using the
item-list(3) command.
Abbreviations
The installation comes with a default abbreviation file for MicroEmacs macro file editing which can be used by writing short abbreviations like "wh" (while), "if" (if), "fu" (function) or "pg" (program) - and then pressing the key-binding for the
expand-abbrev-handle(3) command. The list of abbreviations can be used interactively in the GUI version of MicroEmacs using the
abbrev-list(3) command.
Short Cuts
The short cut keys used within the buffer are:-
C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
C-c esc esc - Command complete.
f2 - (un)fold the current region
f3 - (un)fold all regions
f6 - List items.
esc f6 - Close item list,
Executing, Formatting and Linting Fortran Code
The Fortran file hook supports the
file-exec(3), the
file-format(3) and the
file-lint(3) macros. The tools, compilers which are currently supported are "gfortran" as compilers and linter and "fprettify" as formatters. The formatter can be installed either using your standard package manager system wide or, for the current user, using the Python package manager "pip". Here an example on how to install fprettify using pip:
pip install fprettify --user
BUGS
SEE ALSO
abbrev-list(3),
collapse-all(3),
collapse-current(3),
expand-abbrev-handle(3),
file-exec(3),
file-format(3),
file-lint(3),
indent(2),
item-list(3),
restyle-buffer(3),
restyle-region(3),
time(2m).
Supported File Types
(c) Copyright JASSPA 2025
Last Modified: 2025/08/28
Generated On: 2025/09/29