Skip to content

ZedThree/f90-namelist-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

f90-namelist-mode

f90-namelist-mode

An extension to emacs f90-mode to handle Fortran namelists

Installation

To install, put f90-namelist-mode.el somewhere in your emacs path, for example in ~/.emacs.d/f90-namelist-mode, then put the following in your .emacs:

(add-to-list 'load-path "~/.emacs.d/f90-namelist-mode/")
(require 'f90-namelist-mode)

Fortran input files don’t have a standard filename suffix, so you’ll have to enable this mode manually with M-x f90-namelist-mode, or set a local variable. To do so, just put the following on the first line of your input file:

! -*- mode: f90-namelist -*-

or at the end of your file:

! Local Variables:
! mode: f90-namelist
! End:

To automatically detect Fortran input files and load f90-namelist-mode, you can use the function f90-buffer-is-input-file by adding it to magic-mode-alist in your .emacs:

(add-to-list 'magic-mode-alist
             '(f90-buffer-is-input-file . f90-namelist-mode))

Planned features

  1. Extend the comment regexp to include #
  2. Define indentation rules for:
    • Comment only lines
    • Namelist start/end
    • Key-value line
  3. Add functions to create/find the next/previous namelist/key/value and map them to appropriate keys.
  4. Add function to align on regexp (and auto run it?)

About

An extension to emacs f90-mode to handle Fortran namelists

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published