[Geany-devel] geany bug saving execute commands - filetype none

Lex Trotman elextr at xxxxx
Sat Mar 13 23:52:47 UTC 2010


On 13 March 2010 23:16, Nick Treleaven <nick.treleaven at btinternet.com>wrote:

> On Sat, 13 Mar 2010 09:16:51 +1100
> Lex Trotman <elextr at gmail.com> wrote:
>
> > > There seems to be a bug in trunk if you edit an execute command field
> > > then restart Geany, the changes aren't saved.
>
> > I can only get it to fail if you set the commands when the filetype is
> none.
>
> Sorry I forgot to mention that ;-) I ought to know better.
>
> > This is because executes are saved in the filetypes file and the function
> > filetypes_save_commands() starts at index 1 not 0 so no commands are
> saved
> > for filetype none.
> >
> > Same happens for the filetype commands as well of course.
>
> The None build commands are disabled in the dialog...
>

Hmmmm I'm testing with a new build of r4748 and they are not disabled for a
document with filetype none????


> > Options are:
> >
> > 1. give filetypes none an extension (currently NULL) and let it save
> > 2. make filetype and execute rows of the dialog insensitive if the
> filetype
> > is none
> >
> > I favour option 1 since filetype none is a valid filetype (you can set it
> > from the document menu) so why can't a user define commands for a
> filetype
> > that Geany doesn't understand yet.
>
> Yes, I think 1 is better. Supporting filetype & execute commands for
> ft None is useful.
>
>
There appear to be some wrinkles on extensions for config files that prevent
this working, so I better ask before I change it and break the world.

Commands are loaded and saved in a file with extension from
filetypes_get_extension which does not use the extension field of the
filetype structure, but sets extension to lowercase of filetype name except
in a couple of cases.

On loading filetypes_load_config does not call filetypes_get_extension for
FILETYPE_NONE, instead hard coding it to "common".

Is there any reason (other than historical) to ignore the extension field
when loading and saving, and if so whats the extension field for?


On a wider point, I don't think the GUI should limit setting filetype
> commands just because the config file has no entries listed - e.g. XML.
> The user should still be able to use the dialog to set some commands.
>
>
AFAICT It doesn't limit it,specifically I re-tested with XML & it changed &
saved and restored filetype commands, are you having problems?

It sounds like there is something different in your setup if the dialog sets
filetype commands insensitive somewhere.

Have you also set the filetype command in your project??  If so and the
project is open then the item in the standard dialog is set insensitive so
that you don't edit it and then wonder why it doesn't work (because the
project entry continues to override it).  Thats one of the reasons I want to
put it all in the one dialog in v2 so you can see this.

Cheers
Lex


> Regards,
> Nick
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100314/29010ede/attachment.html>


More information about the Devel mailing list