Article View: gnu.emacs.help
Article #1955Fortran mode
From: Konrad Hinsen
Date: Tue, 15 Dec 1992 09:31
Date: Tue, 15 Dec 1992 09:31
21 lines
1416 bytes
1416 bytes
Many of my Fortran programs make use of the C preprocessor to get around some of Fortran's limitations. This works fine, but I do have some problems editing such files with Emacs in Fortran mode. Whenever a subroutine contains preprocessor directives (starting with a # in the first column), it can't be indented with META-CTRL-Q; reformatting stops with the error message "No comment syntax defined". The easiest solution seemed to me to tell Emacs to ignore such lines alltogether, i.e. treat them as comments (my setup is such that comments are never modified in Fortran mode). After a short look at fortran.el (I am by no means an Emacs-Lisp expert!) I decided that adding # to the first letter group (Cc*) in comment-line-start-skip should suffice; however it didn't have the desired effect. Now I still get the same error message, but in addition all preprocessor directives are indented to column 6! Does anyone know 1) Why my solution doesn't work? 2) What can be done to really solve this problem? Konrad Hinsen (hac041@zam001.zam.kfa-juelich.de)
Technical Details
Message-ID:
<92350.103118HAC041@DJUKFA11.BITNET>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!sdd.hp.com!think.com!yale.edu!ira.uka.de!Sirius.dfn.de!zam103!djukfa11!hac041Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!sdd.hp.com!think.com!yale.edu!ira.uka.de!Sirius.dfn.de!zam103!djukfa11!hac041 From: HAC041@DJUKFA11.BITNET (Konrad Hinsen) Newsgroups: gnu.emacs.help Subject: Fortran mode Message-ID: <92350.103118HAC041@DJUKFA11.BITNET> Date: 15 Dec 92 09:31:18 GMT Organization: Forschungszentrum Juelich Lines: 21