[Geany] more info on syntax highlighting

Enrico Tröger enrico.troeger at xxxxx
Fri Jul 28 19:06:48 UTC 2006


On Fri, 28 Jul 2006 14:34:14 -0400, "John Gabriele" <jmg3000 at gmail.com>
wrote:

> Hi,

> I've got some files in an older defunct scripting language that I'd
> like to edit, but I want to at least have some basic syntax
> highlighting for it.
> 
> Also, I also see that there only *seems* to be only 16 scintilla
> filetypes available:
Yes and no. Geany doesn't use all available lexers provided by
Scintilla. It uses only these which are needed for the
filetypes supported by Geany.

> (well, maybe a couple more since LexOthers.cxx contains a few),
> however in geany: "Document --> Set filetype" I see a number of
> languages listed there that don't seem to be represented by Lex*.cxx
> files, such as "D" (and maybe "O-Matrix" (?)). Furthermore, I don't
D, Java, C++ and C are highlighted by the C++ lexer LexCpp.
O-Matrix has its own lexer, LexOMS. LexOMS is not provided by
Scintilla, I derived it from LexBash, therefore the similarities ;-).

> see Crontab listed in the menu items, even though there's a
> LexCrontab.cxx file for it. (Hm . . . incidentally, LexOMS.cxx &
Why should we support all lexers of Scintilla? Crontab is a filetype I
didn't include in Geany. If someone is there who really wants it, we
can include it.

> What is the correspondence between those Lex*.cxx files and the geany
> menu items in "Document --> Set filetype"?
See src/highlighting.c, every defined filetype(with two or three
exceptions) of Geany has two functions in this file, where the Scintilla
lexer for this filetype is set.

> Can I easily create a new syntax highlighting patterns such that a new
> menu item will show up in "Document --> set filetype"? I already tried
> copying (from $prefix/share/geany to ~/.geany/filedefs), renaming, and
> modifying an existing one, but it doesn't work, and my guess is that I
> first need a scintilla Lex*.cxx file . . . .
Not really. To create a new filetype, many changes are needed. Maybe
this will change in the future but it will be a lot of hard work.
At the moment, the first step is to edit src/filetypes.c and its header
file, then editing src/highlighting.c and a few other things. Maybe,
the easier way is to send me as much information(esp. sample files)
about the filetype as you can and I will add it because I know where I
have to add something ;-).
Of course, if you really want to hack it on yourself, I will help you.


Have a nice weekend, I'm on the way getting out ;-).

Regards,
Enrico

P.S.: one note on OMS:
Some time ago, someone from http://www.omatrix.com/ asked me to create a
filetype for their language. So I did and it is the OMS filetype. But
he didn't answered my last mails since months, so I'm thinking about to
remove this filetype because I think nobody use it.

--
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20060728/dbc12ca2/attachment.pgp>


More information about the Users mailing list