> I'm working witha code that has both fortran 77 and fortran 90 parts. All the 
> files, however, are named *.f, and emacs always opens them with the 'fortran 
> mode', which is actually more fortran77. So, I wonder if there's a way to 
> tell 
> emacs to use a specific 'mode' from the command line, overriding the default 
> definition. Something like:

>  $emacs -f90 my_f90_file.f &

> to force emacs to already open the file with the f90 mode.

Another option than the -*- cookie is to try and autodetect which it is.
I.e. write

     (defun fortran-77-or-90-mode ()
       (if (... check the buffer, looking for special language constructs
            and/or keywords that only exist in one of the two dialects...)
           (fortran-mode)
         (f90-mode)))


-- Stefan
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to