<br><br><div class="gmail_quote">On 15 March 2010 23:21, Nick Treleaven <span dir="ltr"><<a href="mailto:nick.treleaven@btinternet.com">nick.treleaven@btinternet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sun, 14 Mar 2010 10:52:47 +1100<br>
<div class="im">Lex Trotman <<a href="mailto:elextr@gmail.com">elextr@gmail.com</a>> wrote:<br>
<br>
</div><div class="im">> > > This is because executes are saved in the filetypes file and the function<br>
> > > filetypes_save_commands() starts at index 1 not 0 so no commands are<br>
> > saved<br>
> > > for filetype none.<br>
> > ><br>
> > > Same happens for the filetype commands as well of course.<br>
> ><br>
> > The None build commands are disabled in the dialog...<br>
> ><br>
><br>
> Hmmmm I'm testing with a new build of r4748 and they are not disabled for a<br>
> document with filetype none????<br>
<br>
</div>I have r4757 (but the revisions are the same for trunk).<br>
<br>
The 'no filetype' commands are all disabled, but the make commands and<br>
execute are not disabled.<br>
<div class="im"><br>
> > > Options are:<br>
> > ><br>
> > > 1. give filetypes none an extension (currently NULL) and let it save<br>
> > > 2. make filetype and execute rows of the dialog insensitive if the<br>
> > filetype<br>
> > > is none<br>
> > ><br>
> > > I favour option 1 since filetype none is a valid filetype (you can set it<br>
> > > from the document menu) so why can't a user define commands for a<br>
> > filetype<br>
> > > that Geany doesn't understand yet.<br>
> ><br>
> > Yes, I think 1 is better. Supporting filetype & execute commands for<br>
> > ft None is useful.<br>
> ><br>
> ><br>
> There appear to be some wrinkles on extensions for config files that prevent<br>
> this working, so I better ask before I change it and break the world.<br>
><br>
> Commands are loaded and saved in a file with extension from<br>
> filetypes_get_extension which does not use the extension field of the<br>
> filetype structure, but sets extension to lowercase of filetype name except<br>
> in a couple of cases.<br>
><br>
> On loading filetypes_load_config does not call filetypes_get_extension for<br>
> FILETYPE_NONE, instead hard coding it to "common".<br>
><br>
> Is there any reason (other than historical) to ignore the extension field<br>
> when loading and saving, and if so whats the extension field for?<br>
<br>
</div>The extension field is a default for saving new files and it is<br>
configurable, so we can't use this as the basis for config filenames<br>
as it can change.<br></blockquote><div><br>Ok, that makes sense. <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Probably we can fix this to return "none" instead of "common" and<br>
adjust all calling code to still work.<br></blockquote><div><br>Or just store it in filetypes.common, doesn't matter so long as we write to the file we read from :-) Its a separate section so it won't upset any other content.<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
But for now (if it's easier) I think we can just disable the None<br>
filetype's Execute command (and its filetype build commands if there is<br>
a situation where they're not disabled [but I can't find one myself]).<br></blockquote><div><br>Wierd, for me they are always enabled, looking at the code the only time they are set insensitive is if something is overloading them (but you don't have a project), or if doc==NULL or doc->filetype==NULL<br>
Maybe we've got another uninitialised variable that is NULL on your machine but not on mine, but I can't find it.  GCC gives no warnings with -Wall, but thats not authoritative.<br><br>Are the regex fields sensitive or not?<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> On a wider point, I don't think the GUI should limit setting filetype<br>
> > commands just because the config file has no entries listed - e.g. XML.<br>
> > The user should still be able to use the dialog to set some commands.<br>
> ><br>
> ><br>
> AFAICT It doesn't limit it,specifically I re-tested with XML & it changed &<br>
> saved and restored filetype commands, are you having problems?<br>
<br>
</div>Yes, the XML filetype build commands are all disabled.<br>
<div class="im"><br>
> It sounds like there is something different in your setup if the dialog sets<br>
> filetype commands insensitive somewhere.<br>
<br>
</div>I don't think there can be because I tried this with a new config dir<br>
(-c option). Same for the filetype None issue above.<br></blockquote><div><br>I'm using a separate user so I don't conflict with the new stuff, so the whole .config/geany is clean, is that the difference maybe? Don't see how though?<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> Have you also set the filetype command in your project??  If so and the<br>
<br>
</div>All this is without a project open.<br></blockquote><div><br>Ok<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> project is open then the item in the standard dialog is set insensitive so<br>
> that you don't edit it and then wonder why it doesn't work (because the<br>
> project entry continues to override it).  Thats one of the reasons I want to<br>
> put it all in the one dialog in v2 so you can see this.<br>
<br>
</div>That's a separate issue, but I agree that the current situation<br>
can be confusing when a project is open and it needs improving.<br>
<div><div></div><div class="h5"><br>
Regards,<br>
Nick<br></div></div></blockquote><div><br>I'm giving up for the night, if you have any sudden insight during your day let me know, otherwise tomorrow.<br><br>Cheers<br>Lex<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="h5">
_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
</div></div></blockquote></div><br>