[Geany-devel] Custom Filetypes

Lex Trotman elextr at xxxxx
Mon Oct 12 21:40:52 UTC 2009


2009/10/13 Enrico Tröger <enrico.troeger at uvena.de>:
> On Mon, 12 Oct 2009 18:59:24 +1100, Lex wrote:
>
>>Hi Nick, Enrico,
>>
>>I've got a question about how your custom filetype functionality will
>>work when its available, specifically if it will do the following:
>>
>>For the builders WAF and SCONS the config files are actually pieces of
>>python so they need to:
>
> Why do they *need* to do the things listed below?
> I don't get the point what's this about.
>

I use scons, I only had a quick look at waf and you are an expert
(well you can build Geany with it, thats an expert) so where I said
anything wrong about waf please ignore it.

>
>>- detect the custom filetype from the filename (not extension)
>>(SConstruct and SConscript for SCONS and wscript for WAF)
>>- use python lexers and highlighting
>
> the first point is already being done by reading shebang lines if
> available, the second point is done implicitly if the first has
> succeeded.
>

Ok, wscript is a python program, but scons files are *not* complete
programs, no shebang only the filename for identification

>
>>- load tags for the functions provided by SCONS or WAF so tooltips work
>

Again maybe I was wrong about waf, but scons makes a lot of functions
available for use in the script, having tooltips would be useful.
Creating the tags files isn't Geanys problem, just loading them for
the script.


>
>
>>- since the config files are not a complete python program they should
>>not have python compile and run commands, but at least SCONS could
>>have a compile that is "scons --dry_run" and I'm sure WAF has a
>>similar option.  This will automatically work with the new build
>>system so long as the custom filetype functionality creates a separate
>>GeanyFiletype for the custom type and there is a suitable config file.
>
> Are you talking about something like a pendant to the Make commands in
> the build system?

What I'm talking about is when I am working away on my program, have
lots of the C++ files open and the build script which I am editing
trying out something too complicated again (thats the temptation when
its just Python :-).

So I want to see if the script is acceptable to the builder and that
it does the right thing, but without actually doing anything in case
it has a problem. Hence my suggestion that I want to do a dry-run
which prints rather than executes the commands it would run.  That
means I don't want to use the 'make' commands since they have been
configured to run the commands to build the program.

I was suggesting that if the custom filetypes functioned like a real
filetype then I could have a filetype compile command which did the
dry-run when the current document is the script

It seems to me that detecting the build script, using a lexer, loading
specific tags files and having specific compile commands looks really
like a new filetype.

I guess really I have no idea what you intend custom filetypes to do
but I was hoping that it would be easy to add a filetype without
having to edit Geany, thats why I'm asking :-)

Cheers
Lex

>
>
>
> Regards,
> Enrico
>
> --
> Get my GPG key from http://www.uvena.de/pub.asc
>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>



More information about the Devel mailing list