I'm updating some fortran 77 code to use fortran 90 constructs and emacs is my editor of choice. Currently, the source is in fixed format and that isn't going to change any time soon (due to external constraints). The two emacs major modes that I can choose from are fortran-mode
which only highlights the syntax for fortran 77 constructs (It doesn't understand module
or contains
, etc. as keywords which I find pretty annoying, but it does understand fixed format -- correctly indenting the code where necessary). The other major mode I could use is f90-mode
, however, that gets the indentation all wrong which is also slightly annoying. Is there any way to get the syntax highlighting from f90-mode
, but the indentation structure used in fortran-mode
?
相关问题
- Symbol's function definition is void: declare-
- CABS(x) function for complex(8)
- How can I set the SVN password with Emacs 23.1 bui
- Emacs shell: save commit message
- Upper bound of random number generator
相关文章
- ess-rdired: I get this error “no ESS process is as
- Emacs/xterm color annoyance on Linux
- Does gfortran take advantage of DO CONCURRENT?
- Pipe less to Emacs
- Fortran 90 - “Segmentation fault - invalid memory
- Capturing the output of “diff” with org-babel
- emacs terminal mode: how to copy and paste efficie
- How to permanently enable the hs-minor-mode in ema
You can achieve some fortran90 like highlighting in
fortran-mode
by addingto your ~/.emacs (or ~/.emacs.d/init.el) file.
For a comprehensive solution some additional work with regular expressions would be needed. But with a few lines, you should be able to feel comfortable with your code. Different colors can be gained by using different faces:
It looks like this is indeed possible. Try adding the following to your config file:
This is just following the solution provided on emacs.stackexchange.com, so thanks should flow to user deprecated!