I think I found out what went wrong for you:
Solution
It's good and right, that you changed the id
(and _name
) in the <language ...>
tag. After all it is a new highlighting scheme you create.
However you then have to change also the other place in the file where this id is used. Further down in the language definition (omitted in the quote in the question) you find this:
<context id="fortran" class="no-spell-check">
Apparently, you have to have a context with the same id as you language including/referring all the used context definitions, so that gedit/GtkSourceView uses it when a specific scheme is chosen.
How I found it
I am not at all an expert in this. All my qualification is that I have seen XML files before ;) So I could only make "educated" guesses.
What tipped me off was a warning shown when starting gedit from a terminal window
(gedit:6786): GtkSourceView-WARNING **: Failed to load
'/usr/local/share/gtksourceview-3.0/language-specs/frtrn.lang':
Missing main language definition (id = "frtrn".)
(I used "frtrn" as id, name and file extension while testing, you should get the same warning with "fortran_enhanced")
This made me suspicious enough to search for the original ID in the rest of the file. After trying out the above solution I also found the following line to support my explanation:
[definitions]
Here we should define a main context, the one we enter at the
beginning of the file: to do so we use the tag, with an id
equal to the id of the element
[...]
It's from the language definition file tutorial in the GtkSourceView documentation.
I had a similar problem (caused by a different bug), but the underlying causes might be similar enough for this to work:
gedit saves metadata about all known files using the GnomeVFS. If that metadata contains something gedit doesn't "like", it crashes.
As a workaround, create a copy of the file from the command line (not in Nautilus). cp doesn't preserve the metadata, so this allow you to open the file if the metadata is in fact the problem.
In case it is, you can inspect the file's metadata by executing the following command:
gvfs-info -a metadata FILENAME
Then, one by one, try erasing the entries using the following syntax:
gvfs-set-attribute FILENAME metadata::ATTRIBUTE ''
Best Answer
Not forced reloading, but revert to last saved version. File/Revert.
The keystroke combination is Alt - R, R, Alt - R.