[Geany-devel] Custom filetypes - was Re: abc tagmanager patch

Nick Treleaven nick.treleaven at xxxxx
Sat Sep 12 16:09:56 UTC 2009

On Tue, 8 Sep 2009 11:15:50 +1000
Lex Trotman <elextr at gmail.com> wrote:

> >>they don't do much harm, its a pity Scintilla doesn't have a loadable
> >>lexer capability so languages can be selected by users without loading
> >>the lexer code for all of them even if I don't want them.
> >
> > I think Scintilla has this, at least some sort of. But I never got into
> > it to find out how it works in detail, so I can't say much about it.
> Ah yes, external lexers, I had a quick look at Scintilla.  The
> interface looks pretty simple.
> Now if the filetypes array is extendible at runtime (g_array maybe)
> and with the exporting of a few extra functions to plugins then a
> plugin could add a language.  All the plugin would need was to create
> the filetype entry and tell scintilla to load the lexer if it wasn't
> already loaded.  (I think, you will doubtless now tell me that there
> is heaps more to do :-)
> And then, after a period of discussion, argument, fighting, voting,
> consulting chicken entrails or other appropriate method of making a
> decision some less used languages could be moved to plugins so users
> need only load those they want :-)

Hehe ;-)

Basically, the easiest way to do this is not by plugins but by custom
filetypes. This means that the filetypes array never changes once
the interface is created and so existing code should just work. I've
done some work on this already, but ATM only basic filetypes
[settings] section stuff works. I'm going to work on the custom lexer
stuff next.



More information about the Devel mailing list