[Geany] {filename} and New with Template (Re: Template for C++ headers)

Enrico Tröger enrico.troeger at xxxxx
Wed Nov 12 20:08:37 UTC 2008


On Wed, 12 Nov 2008 12:34:59 +0000, Nick Treleaven
<nick.treleaven at btinternet.com> wrote:

>On Mon, 10 Nov 2008 21:17:48 +0100
>Enrico Tröger <enrico.troeger at uvena.de> wrote:
>
>> >thanks for reply. it would be great to move all template related
>> >stuff into a plugin. most ide's like eclipse or netbeans or even vs
>> >first ask user to select a template and then to specify a name for
>> >the new file. if i'm not mistaken eclipse cdt can create unnamed
>> >files the same way geany does but in such cases it doesn't use any
>> >templates. so geany is just missing asking for a filename. It'd be
>> >nice if you make it
>> 
>> Yes, Geany asks first for the filename when the file is actually to
>> be saved, not when creating. I like it this way as it makes creating
>> files more easy and fast.
>
>One idea: maybe when using New with Template and the template uses
>{filename}, Geany could flag this in a private document field, and not
>transform it until the file is saved. On saving, Geany could check
>if the 'replace_template_filename' field is set, and replace all
>instances of {filename} with the proper filename.

This still won't solve the problem of replacing {filename} with
HEADERFILE_H. But maybe we could add another wildcard like {FILENAME}
which will replace the filename with an uppercase variant.

Maybe we don't need an additional flag at all
when we extend the existing code in replace_header_filename()
(document.c) to work on the whole file, not only the first three lines.

But I'd still like to have all this done in a plugin in some way.
Either a new one or by extending the classbuilder plugin to be more
flexible.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20081112/c1451cb9/attachment.pgp>


More information about the Users mailing list