Source files with uppercase .F77 file extension do not syntax highlight when opened. .F90 works perfectly.
![f77-bug-001](https://user-images.githubusercontent.com/1883220/223439874-e257d5e9-bbef-41...) ![f77-bug-002](https://user-images.githubusercontent.com/1883220/223439908-27e2f558-fc2b-45...) ![f77-bug-003](https://user-images.githubusercontent.com/1883220/223439933-54744f3c-ccb0-48...) ![f77-bug-004](https://user-images.githubusercontent.com/1883220/223439955-59ccbc64-faa3-4c...)
Well its not listed [here](https://github.com/geany/geany/blob/afec6557e0f453a38b2976069de3763b8e1d09d1...). I guess the people who made that filetype didn't accept it.
`Tools->Configuration Files->filetype_extensions.conf` and add it to your own copy.
I added *.F77 there and it didn't work.
On 3/7/23 07:48, elextr wrote:
Well its not listed here https://github.com/geany/geany/blob/afec6557e0f453a38b2976069de3763b8e1d09d1/data/filetype_extensions.conf#L30. I guess the people who made that filetype didn't accept it.
|Tools->Configuration Files->filetype_extensions.conf| and add it to your own copy.
— Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/3425#issuecomment-1458205600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOLYVDDUEF7NR3YSNCDLI3W244ENANCNFSM6AAAAAAVSPXYKQ. You are receiving this because you authored the thread.Message ID: ***@***.***>
I presume you removed the comments (the `#~ `) from the `[extensions]` heading and the `F77=` line?
You presume correct.
There is something not loved with .F77. If I save it to lowercase .f77
It now gets love. The correct file remains unloved.
I restarted Geany and everything. Just to be complete.
I'm guessing there is an oopsie with the file extension matches the syntax tag. These source files came from OpenVMS where they are and must remain uppercase.
On 3/7/23 07:59, elextr wrote:
I presume you removed the comments (the |#~ |) from the |[extensions]| heading and the |F77=| line?
— Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/3425#issuecomment-1458222277, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOLYVB4YSYFPTHPSXCJXELW245LJANCNFSM6AAAAAAVSPXYKQ. You are receiving this because you authored the thread.Message ID: ***@***.***>
What system are you running Geany on?
What filetype shows in the status bar for one of those files?
Per the original post
system specs
For the .F77 file
f77 bottom of window
For the .f77 file
.f77 bottom of window On 3/7/23 08:30, elextr wrote:
What system are you running Geany on?
What filetype shows in the status bar for one of those files?
— Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/3425#issuecomment-1458273699, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOLYVHRG5HAISMDKXACFILW25BBXANCNFSM6AAAAAAVSPXYKQ. You are receiving this because you authored the thread.Message ID: ***@***.***>
For the .F77 file
f77 bottom of window
What? Thats not a Geany filetype, the Geany filetype is `F77` (filetypes are case sensitive) Are you loading a custom filetype?
For the .f77 file
.f77 bottom of window
Again, thats not a Geany filetype, none have a `.` at the start.
It looks like its finding _something_ as a filetype, but not the right thing.
What version of Geany? Do you have any custom filetypes?
PS you have been caught by the github edit trap, I added a couple of extra questions to my previous comment, but github doesn't email edits, so you missed them. Its always best to go to github, not answer the email.
**What a crummy email interface GitHub has!!!!!!** I couldn't understand your questions but this (*&)(*&)(*& strips out images from email. I use images so we don't end up going down a terminology rabbit hole. Kind of like you asking for a "Geany filetype" without explaining what you mean. I've been in IT over 30 years writing software on many platforms and given the pictures I provided I had no clue what you were asking. Now I realize you never saw the pictures. GitHub really is barbaric.
I'm dealing with relative in hospital. Can check email, but cannot always get to GitHub and even if I could would need screen shots from this machine in office.
So, from the beginning: System
![f77-bug-001](https://user-images.githubusercontent.com/1883220/223739389-eeafc24e-cc94-4b...)
Configured file types ![f77-bug-030](https://user-images.githubusercontent.com/1883220/223740022-77398f02-cbbc-4f...)
That was only uncommented with .F77 added __after__ Geany failed to recognize .F77 as a Fortran 77 file extension.
.F90 file extension worked out of the box ![f77-bug-003](https://user-images.githubusercontent.com/1883220/223740561-f12f5cf2-f8dd-4c...) ![f77-bug-032](https://user-images.githubusercontent.com/1883220/223741006-9c50df92-8b84-43...)
.F77 file extension does not, even with the addition in ~/.config/geany/filetype_extensions.conf and a restart of Geany ![f77-bug-004](https://user-images.githubusercontent.com/1883220/223741416-c4c3bd22-305c-47...) ![f77-bug-010](https://user-images.githubusercontent.com/1883220/223741456-75e27167-3dca-42...)
If I save that exact file with a .f77 file extension Geany likes it. ![f77-bug-033](https://user-images.githubusercontent.com/1883220/223741983-f0368376-7390-49...) ![f77-bug-034](https://user-images.githubusercontent.com/1883220/223742015-203e402c-bcd6-42...)
Even if I change the system level file and restart Geany, it does not like files with .F77 extension. ![f77-bug-035](https://user-images.githubusercontent.com/1883220/223744938-a1d33f2f-d885-40...) ![f77-bug-036](https://user-images.githubusercontent.com/1883220/223744971-c6e3d20d-eb5c-47...)
When I went back in for grins and giggles to my local .conf and added *.F78; after the *.F77; then saved, Geany now started liking .F77 files. Didn't have to exit at all.
Here is a short .F77 file if you wish to test.
FTN_FILL_IN_LOGICALS.F77 ``` SUBROUTINE FTN_FILL_IN_LOGICALS IMPLICIT NONE C C Subroutine to fill in all of the logicals needed by the C Mega_Zillionare application when written in fortran C
INCLUDE 'SYS$LIBRARY:FORSYSDEF(LIB$ROUTINES)'
C;;;;; C Fill in default file names C;;;;; CHARACTER*12 DRAWING_DATA DATA DRAWING_DATA/'MY_MEGA_FILE'/
CHARACTER*13 DRAWING_STATS DATA DRAWING_STATS/'DRAWING_STATS'/
CHARACTER*10 MEGA_STATS DATA MEGA_STATS/'MEGA_STATS'/
CHARACTER*255 TRANSLATED_NAME_STR, WORK_STR CHARACTER*1 FIRST_CHAR INTEGER*4 L_X INTEGER*2 W_X LOGICAL IS_BLANK_LG
C;;;;; C Make certain the drawing_data logical exists C if not, give it a value in the local directory C;;;;; TRANSLATED_NAME_STR = ' ' L_X = LIB$GET_LOGICAL( DRAWING_DATA, TRANSLATED_NAME_STR, 1 W_X,,,,)
FIRST_CHAR = TRANSLATED_NAME_STR IS_BLANK_LG = FIRST_CHAR .EQ. ' '
IF (IS_BLANK_LG) THEN TRANSLATED_NAME_STR = DRAWING_DATA // '.IDX' L_X = LIB$SET_LOGICAL( DRAWING_DATA, 1 TRANSLATED_NAME_STR,,,) END IF
TRANSLATED_NAME_STR = ' ' L_X = LIB$GET_LOGICAL( DRAWING_STATS, TRANSLATED_NAME_STR, 1 W_X,,,,)
IF (TRANSLATED_NAME_STR(1:1) .EQ. ' ') THEN TRANSLATED_NAME_STR = DRAWING_STATS // '.IDX' L_X = LIB$SET_LOGICAL( DRAWING_STATS, 1 TRANSLATED_NAME_STR,,,) END IF
TRANSLATED_NAME_STR = ' ' L_X = LIB$GET_LOGICAL( MEGA_STATS, TRANSLATED_NAME_STR, 1 W_X,,,,)
FIRST_CHAR = TRANSLATED_NAME_STR
IF (FIRST_CHAR .EQ. ' ') THEN TRANSLATED_NAME_STR = MEGA_STATS // '.IDX' L_X = LIB$SET_LOGICAL( MEGA_STATS, 1 TRANSLATED_NAME_STR,,,) END IF
RETURN END
```
This acts like multiple things are going on.
1. Geany stores whatever syntax it was using and never checks again until a "new" .conf requires a reload. Stopping and starting Geany will not "fix" an existing opened file. 2. There is some kind of parsing error for the F77 geany type that doesn't like *.F77; if it is the last thing in the line. I mean I tried opening many different files after changing both local .conf and system without Geany recognizing .F77 as an F77 file. 3. Something else I haven't tracked down.
On the big systems *.F is common for Fortran IV or earlier (Yes, lots of that still in production.) *.FIV for shops that were straddling the change between Fortran IV and Fortran 77 *.F77 for Fortran 77. We always used upper case because that is all the early terminals had.
I hope this answers all of the questions.
As a workaround, if these file extensions could just be "functional" in the base package the other issues wouldn't surface.
What a crummy email interface GitHub has!!!!!!
No argument, it should remove it and just be a website with email notifications.
Kind of like you asking for a "Geany filetype" without explaining what you mean.
"Filetype" is basic terminology used throughout the Geany manual and UI (`Document->Set Filetype-> ...` etc ) and is displayed in the status bar as `filetype: F77` as your new image shows and thats explicitly what I asked for: "What filetype shows in the status bar for one of those files?". Sadly your original images did not show the status bar but your new one does and it correctly shows `F77`.
Images have their uses, but should be used sparingly, you are spamming everybody watching the repo with them and as above they often omit the important part.
Thank you for the example, for the same reason as above, next time please put it in a [Gist](https://gist.github.com/) and just paste the link here.
The example highlights here when opened after I add `*.F77;` to the `filetype.extensions` file.
Geany stores whatever syntax it was using and never checks again until a "new" .conf requires a reload. Stopping and starting Geany will not "fix" an existing opened file.
What I think you call the "syntax" is the "filetype" we are talking about, and yes Geany will not change the filetype of an opened file, because a user can set the filetype and it should not therefore be changed. That is preserved in the Geany session and therefore over restart. You can either set it yourself, or close and re-open the file.
... changing both local .conf and system ...
If you mean you edited the files directly instead of the suggested method [here](https://github.com/geany/geany/issues/3425#issuecomment-1458205600)? If so you need to reload configuration, or restart Geany to load the edited config file, whereas using the menu does it automatically on save. Then you also need to re-open the file to have its filetype autodetected again.
There is some kind of parsing error for the F77 geany type that doesn't like *.F77; if it is the last thing in the line.
Works here, the `F77` line in my `filetype.extensions` is exactly the same as that shown in your image and your example (saved as `/tmp/untitled.F77`) works. I am not sure where the problem is, I can't see your setup, but the parsing of conf files is performed by the Glib library that is in use everywhere GTK is, not Geany code, so its unlikely it has such an obvious bug as missing the end of the list. I suspect a procedure issue as explained above which was cured when you made an additional change.
As a workaround, if these file extensions could just be "functional" in the base package the other issues wouldn't surface.
Not sure what you mean, is that "functional" as in functional languages like Haskell or what?
The filetype extensions are specified in a configuration file exactly to cater for examples like this, where a specific use-case needs additional extensions, and to allow users to tailor the annoying case of two applications using the same extension (Matlab and Objective C `.m` for example).
I've been in IT over 30 years writing software on many platforms and given the pictures I provided I had no clue what you were asking.
Well as I have 15+ __more__ years experience than you I guess I can call you a newby :smile:
But its very likely that whoever contributed the fortran filetype and extensions list was even younger and had never heard of VMS, or a Teletype, (ASR33 anybody?) so since `.F77` isn't listed as an extension for GNU gfortran (but `.f77` is) it wasn't added to the list. Geany is a volunteer project and people contribute what they know about.
Geany stores whatever syntax it was using and never checks again […]. Stopping and starting Geany will not "fix" an existing opened file.
Isn't that the *only* real issue here? No, Geany won't change the file type of a loaded file, even on restart, so long as it's part of the session. To force redetection, the simplest solution is to close and reopen *the file*.
So if you had your .F77 file open all along, no, changing the extensions lists will not have helped. Of course, when you added .F78 I guess you loaded such a file *afterwards* and thus it worked.
Have you tried to open .F77 files you never had before, or Close each file and reopen them? I really can't figure out why .F77 in particular would give *you* trouble…
Geany stores whatever syntax it was using and never checks again […]. Stopping and starting Geany will not "fix" an existing opened file.
Isn't that the only real issue here?
No. I had many files to choose from. I closed all that were open. I bounced Geany and chose different .F77 files. I just replicated the entire problem on this system as well. ![f77-bug-100](https://user-images.githubusercontent.com/1883220/224029659-56c4d8e5-a179-44...)
I made the change to extensions, saved the file, bounced Geany, loaded a completely different .F77 file and had it not highlight. When *.F77; isn't dead last in the list, it works. When it is dead last highlighting does not work.
At this point I'm done. I've reported the bug, reproduced the bug on an entirely different system, and answered questions. I use pictures so I don't get pulled into a terminology war and now I'm being pulled into a terminology war. I always paste everything in the report because using something like Gist is _exactly_ how critical information gets lost. Internet rot strikes without warning.
Thank you for your time.
I now have to go un-install Geany from the 6-8 machines that will be used for this project. They will either have to use Emacs to have a combined editor and GDB front end or split editor and GDB front end.
Fix it, don't fix it, I've reported it and replicated it on different OS.
As I said, works for me.
Although you have reported it, if we can't reproduce it we can't fix it. Seems there is something unusual about your system that doesn't occur here.
Note I also tested with LMDE 5 and the Geany it supplies, 1.37.1 as well as current git version, both worked.
OK, so, I still cannot reproduce the issue (yet I have a clue, see below), but I made #3427 to fix that for good and make it "functional by default".
Now, to what I think the issue is: looking at your screenshot of the *filetype_extensions.conf* file: ![f77-bug-030](https://user-images.githubusercontent.com/1883220/223740022-77398f02-cbbc-4f...) we don't really see clearly the symbols tree, but the piece we see `7 [30]` refers to the `F77` key: the line matches, and it should show up. However, it *seems* to be on the *second row of the tree*, which it should not. The tree should look like so: ![f77stree](https://user-images.githubusercontent.com/793526/224167613-8d6566e0-8bd0-4ce...) Notice that: * `F77` is on the 3rd row * `Extensions [4]` above is wider so should show up in your capture.
This leads me to believe that the issue is that you did not uncomment the `[Extensions]` section on line 4. Admittedly it's not obvious one has to do that, although [@elextr mentioned it](https://github.com/geany/geany/issues/3425#issuecomment-1458222277), but #3413 should improve the situation (and I believe, would have prevented you from most of the pain).
FWIW, this *filetype_extensions.conf* should suffice to solve the initial issue: ```ini # Filetype extension configuration file for Geany # Insert as many items as you want, separate them with a ";". # See Geany's main documentation for details. [Extensions] F77=*.f;*.for;*.ftn;*.f77;*.F;*.FOR;*.FTN;*.fpp;*.FPP;*.F77; ```
Closed #3425 as completed via 39d1e7f53a2b77cb0527f8368a49164b7ae6372f.
github-comments@lists.geany.org