[gedit-list] problem with colorization of fortran-95 in 2.14 (perhaps solved in later versions)
- From: "Nino R. Pereira" <pereira speakeasy net>
- To: gedit-list gnome org
- Subject: [gedit-list] problem with colorization of fortran-95 in 2.14 (perhaps solved in later versions)
- Date: Mon, 28 Jan 2008 11:12:54 -0500
Hi,
my thanks to the people who gave feedback on my earlier post, and
apologies for stepping out of this mailing list.
Here is my way of resolving the issue, for now.
The problem (in highlighing fortran-95 source code, the line
after a 'C' or 'c' was colored (blue) as if it were a comment,
may have been dealt with in a later version (certainly 2.20.1) of gedit,
which I do not have. Debian etch comes with gedit 2.14: according
to apt-get, this is the latest package. I could update to the latest and
greatest, 2.21.1, but I was warned that this may demand more
complicated things than I feel comfortable with, so I preferred to
remain with the installed version and, instead, modify the file
with the language specification (fortran.lang).
The following is now the section in this file that deals with comments:
<!-- Note: contains an hack to avoid considering ^COMMON a comment:
an 'o' or 'O' after the 'c' or 'C' could be 'common, hence not a
comment.
This may or may not be true: any other word with 'CO' (cooperation,
etc.)
falls in the same category.
The line with (\b[^Oo] made the line after a comment line into a comment
too: on the suggestion of Paolo Borelli this is replaced by the
line with [ \t]. -->
<!-- Note: you can not put comments in between <line-comment ...> and
</line-comment ...> -->
<!-- <start-regex>!|(^[Cc](\b|[^Oo]))</start-regex> is the original line
(gedit 2.14.) -->
<!-- <start-regex>!|(^[Cc])</start-regex> works, but doesn't have the
'hack for '^COMMON'. -->
<line-comment _name = "Line Comment" style= "Comment">
<start-regex>!|(^[Cc]([ \t]|[^Oo]))</start-regex>
</line-comment>
It works! I added some comments so that I might remember what all this
means if and when I ever have to get back to this file. They also make it
clear that this is
the first time I saw XML, so that I didn't really know how to deal with
it. But, some diddling
solved this problem too.
If I could find out what version 2.21.1 does with this I'll be happy to
file a bug notice,
but since I'm reluctant to take the risk to mess up the gedit version that
now works for
me, you will (hopefully) excuse me if I don't. I will try, though, to find
the actual
specs for fortran-95 and compare those with what gedit does: I vaguely
remember that this
spec introduced a difference between 'C' and 'c'. Any such spec (if it
exists) would not
be treated properly in the present version of fortran.lang.
Thank you for your help, and for developing such a nice editor!
Nino
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]