Not sure what filetypes.conf is for, I can't find anywhere that Geany reads it, but looking at its history it seems to be intended to be a template for built-in filetypes, maybe, but its not clear??? Anyhow as its not loaded (AFAICT) and not referenced in the documentation so just forget it until someone else can explain its usage (anybody?).

I have looked in filetypes.perl for some hint as to which lexer it uses

Perl is built-in so the lexer choice is hard coded, so nothing is needed in the filetypes file, same for tags parsers. For Perl the lexer is this. The easiest way of telling which lexer/parser a built-in uses should be the filename in this directory, or in the ctags parsers directory.

Lexers come from the Lexilla and unfortunately their documentation is their code, so properties and numbers of keyword lists need to be gleaned from their code, or for custom filetypes by reading the base filetype file which should be updated if needed every time the lexer is updated.

Edit these in the colorscheme .conf file instead

See here

Before colour schemes were invented the mapping between lexical entities and styles was in the filetypes files, where the comment is, now the filetypes files map lexical entities to named styles and the colour scheme file maps named styles to colours. The intention is that similar entities in all languages would map to the same named colour so users of multiple filetypes would get similar colouring, and colour schemes wouldn't have to have mappings for each filetype, but of course anybody can (mis)configure it in their custom filetype file for their language or the user override for the builtin filetype file.

which .conf I should perhaps start with?

The manual suggests copying the builtin filetype file and adding the lexer_filetype and tag_parser keys whose value is the builtin filetype name. That will copy the right number of keyword lists and lexical element to named style mappings, but they will override any changes that happen in the builtin in future Geany releases. Or as explained here you can get them from the builtin, and then only change ones you actually need to, thats probably preferable.

Custom styles, colour schemes, and various other changes have happened over a long period of time, not all at once, and manual updating is done by the people doing the changes, who totally understand their change, so are brief in the manual and only note their part and not the whole. Also contributors do not always speak English as a first language so again they are brief.

A full tutorial or howto on creating custom filetypes and configuring the filetypes system would be good, but Geany is a totally volunteer project, nobody is paid to do anything, and nobody can be forced to do anything, and so most contributions are things people are capable of, are interested in, or find useful for themselves. So far nobody has seen fit to contribute such a document or to improve the manual.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/issues/3232/1181255972@github.com>