hi!!
I have recently tried geany and I am really surprised of the work done in this "small" IDE. It's definitely the nicest / most intuitive IDE I have ever tried.
And now about the problem. I use to program a lot in fortran. Unfortunately I found out that geany doesn't distinguish between fix and free fortran format. After a short look into the scintilla part in geany sources I realized that only the free format lexer of sintilla is currently linked and used in geany (lmfortran and not lmf77 of LexerFortran.cxx).
But that's not really the problem. The problem is that the chosen scintilla free format lexer seems to apply on everything between column 7 an column 72, which is a fix format convention. That means the source code is truncated between the 7th and 72th column, like it was fixed format and then highlighting is applied using the lmfortran scintilla lexer like we had fortran free format source code. The same problem is related to folding (because of truncating everything before the 7nth column).
As result of this inconsistency neither fortran fix format nor fortran free format is being highlighted and folded correctly.
About the solution.
At first one should repair the fortran free format by not truncating the code lines. Or rather truncating them from the first column up to the column defined in geany as maximum line length. In the menu Document->Set filetype -> Fortran Source File (F77) the specification (F77) has also to be omitted (actually this statement is anyway not 100% true). As Compiler and Linker the "g77" option in "filetype.fortran" should be replaced by "g95".
Most users (me too) would be happy with only this modification. Anyway most fix format fortran code was written in a period where not only text highlighting but even color monitors were scientific fiction.
In a second step, in order to also repair the fix format representation one should define two distinct filetypes one for the fix format and the file extensions *.f, *.for, *.ftn and *.f77 and one for the free format and the file extensions *.f90,*f95,*.f2k. For the fix format filetype the lexer module lmf77 of LexerFortran.cxx should be linked instead of lmfortran. The g77 compiler should be used for compiling and linking.
SciTE currently treats fixed and free fortran format correctly. It would be useful to compare.
For the implementation of any solution for the problem mentioned here I am always willing to help. I could test a solution or I could work on a solution if I had some advise where to begin and what is your opinion about my suggestions.
Best Regards
Kostas
On Sat, 15 Mar 2008 11:53:19 +0100, Konstantinos Poulios poulios.konstantinos@googlemail.com wrote:
Hi,
most important first: this is a mailing list. In order to receive further answers, you should subscribe to this list (http://lists.uvena.de/cgi-bin/mailman/listinfo/geany).
I have recently tried geany and I am really surprised of the work done in this "small" IDE. It's definitely the nicest / most intuitive IDE I have ever tried.
Thanks.
[...] At first one should repair the fortran free format by not truncating the code lines. Or rather truncating them from the first column up to the column defined in geany as maximum line length. In the menu Document->Set filetype -> Fortran Source File (F77) the specification (F77) has also to be omitted (actually this statement is anyway not 100% true). As Compiler and Linker the "g77" option in "filetype.fortran" should be replaced by "g95".
So, after this change we actually support Fortran 95 (or however it is called). Currently we support a mix of both? I'm sorry for all this, I don't know Fortran at all. Someone requested this in the past(in August 2006) and I remember I asked which kind of the language to support.
In a second step, in order to also repair the fix format representation one should define two distinct filetypes one for the fix format and the file extensions *.f, *.for, *.ftn and *.f77 and one for the free format and the file extensions *.f90,*f95,*.f2k. For the fix format filetype the lexer module lmf77 of LexerFortran.cxx should be linked instead of lmfortran. The g77 compiler should be used for compiling and linking.
Hmmm, this is why I asked the person who originally requested Fortran support what is more often used nowadays. Because I didn't want to add two Fortran filetypes. Are we really both versions still used?
Regards, Enrico
Enrico Tröger wrote:
On Sat, 15 Mar 2008 11:53:19 +0100, Konstantinos Poulios poulios.konstantinos@googlemail.com wrote:
Hi,
most important first: this is a mailing list. In order to receive further answers, you should subscribe to this list (http://lists.uvena.de/cgi-bin/mailman/listinfo/geany).
I have recently tried geany and I am really surprised of the work done in this "small" IDE. It's definitely the nicest / most intuitive IDE I have ever tried.
Thanks.
[...] At first one should repair the fortran free format by not truncating the code lines. Or rather truncating them from the first column up to the column defined in geany as maximum line length. In the menu Document->Set filetype -> Fortran Source File (F77) the specification (F77) has also to be omitted (actually this statement is anyway not 100% true). As Compiler and Linker the "g77" option in "filetype.fortran" should be replaced by "g95".
So, after this change we actually support Fortran 95 (or however it is called). Currently we support a mix of both? I'm sorry for all this, I don't know Fortran at all. Someone requested this in the past(in August 2006) and I remember I asked which kind of the language to support.
In a second step, in order to also repair the fix format representation one should define two distinct filetypes one for the fix format and the file extensions *.f, *.for, *.ftn and *.f77 and one for the free format and the file extensions *.f90,*f95,*.f2k. For the fix format filetype the lexer module lmf77 of LexerFortran.cxx should be linked instead of lmfortran. The g77 compiler should be used for compiling and linking.
Hmmm, this is why I asked the person who originally requested Fortran support what is more often used nowadays. Because I didn't want to add two Fortran filetypes. Are we really both versions still used?
Yes. While new development may choose f9x, there's still a lot of legacy f77 code which requires the fixed format, unfortunately.
Regards, Enrico
The compiler setting is another thing, though. By now, gfortran should be able to compile f77 code as well. (If not, file a bug; to gfortran, of course :-) to make it better.) Anyway, a user can always change the setting to use whatever he/she needs.
Regards, ST --
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany