On 7 May 2010 22:56, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 7 May 2010 22:18:57 +1000 Lex Trotman elextr@gmail.com wrote:
Perhaps the {filename} could be left in the file until it is saved the
first
time and all occurrences replaced. But then, are there any languages
where
that is a valid sequence? Looks vaguely like Perl or Ruby but its been a while since I've used them??
Right near the beginning, my Ruby book has the example line :-)
puts "Can't open file #{filename}"
Maybe templates are going to have to force
immediate saving so they can get a filename.
After the 0.19 release I think we could maybe do this: Replace {filename} with e.g. {GEANY_TEMPLATE_filename} and set a document flag. When first saving the new file, if the flag is set, replace {GEANY_TEMPLATE_filename} with the real filename.
I think that string is unlikely to occur in a file, and much less in an unsaved document.
Good solution, then also GEANY_TEMPLATE_filebase and I would request GEANY_TEMPLATE_filebasecaps for use in header guards where macros should be all caps.
I don't think this uglification is needed for the substitutions that are made as the template is loaded, just those made at save time after the user has time to type any arbitrary text, but you might want to make them all consistent.
Cheers Lex
As for the scrambled screen, I'm not sure what that is, but it probably isn't related to the template, does it happen with any other existing
files?
I suggest that you post the tgz to the mailing list (taking out anything that you don't want on a public forum of course) so that Nick/Enrico can look at it.
Maybe post in a new thread.
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany