I work a lot with Fortran, both with newer standards like f90/f95 (f90-mode in emacs) as well as the f77 standard (fortran-mode in emacs). I want to enable flycheck so it works with both standards (depending on mode), instead of just one. By default, flycheck only works on the newer f90/f95 standard.
According to their documentation, one can modify the
flycheck-gfortran-language-standard variable to control the fortran standard in use, but so far I've only been able to make it work with one at a time. I tried the following solution:
(add-hook 'f90-mode-hook (lambda () (make-local-variable 'flycheck-gfortran-language-standard) (setq flycheck-gfortran-language-standard "f95"))) (add-hook 'fortran-mode-hook (lambda () (make-local-variable 'flycheck-gfortran-language-standard) (setq flycheck-gfortran-language-standard "legacy")))
but it didn't seem to have any effect. Basically, what I was hoping would happen is that the variable
flycheck-gfortran-language-standard would be modified according to the major mode that I was in. That is, it would have the value "f95" in
f90-mode and the value "legacy" in