[Geany] Different templates for .c and .h?

Joerg Desch jd.vvd at xxxxx
Thu Apr 29 07:59:49 UTC 2010


On Wed, 28 Apr 2010 14:18:05 +0100
Nick Treleaven <nick.treleaven at btinternet.com> wrote:

Hi Nick.

> Basically you just make a number of files like source.c, header.h and
> put them in ~/.config/geany/templates/files/. They should appear in the
> 'New with template' menu.

Thanks. This works fine. But as always, there is something that doesn't
work as expected. ;-)

The template wildcard {filename} is replaced with "unnamed.c" (in German
"unbenannt.c"). This isn't a good choose, because you have to rename it
afterwards. Wouldn't it be better to open a dialog and ask for the name
to use?

While we talk about template wildcards. Please add {filebasename}! Below
is a part of my header template. You can easily see the reason for
{filebasename}...

=============================================================
/* -*- Mode: C -*-
 *
 * $Id$
 * --------------------------------------------------------------------------
 * Copyright  (c) {company}
 * --------------------------------------------------------------------------
 * PROJECT: 
 * MODULE.: {filename}
 * AUTHOR.: {developer}
 * CREATED: {datetime}
 * --------------------------------------------------------------------------
 * DESCRIPTION:
 *
 * --------------------------------------------------------------------------
 * COMPILER-FLAGS:
 *
 * --------------------------------------------------------------------------
 */

#ifndef __{basefilename}_H__
#define __{basefilename}_H__ 1

=============================================================

-- 
Email: Joerg Desch <jd DOT vvd AT web DOT de>



More information about the Users mailing list