Have a look at ELSE (Emacs Language Sensitive Editor) mode at:

http://home.exetel.com.au/peterm/

Does exactly what you want and (IMO :-)) easier to use than skeleton mode etc



On Thu, Apr 17, 2008 at 2:48 AM, Thierry Volpiatto <thierry.volpiatto@gmail.com> wrote:
Alain Muls <alain.muls@telenet.be> writes:

> Hello,
>
> I use emacs/ecb for programming in C/C++.
>
> I would like to have functions available that insert templates such as
> the 'if .. then .. else' construct or a certain Qt function that I use
> regularly. How can I do that, I am not used to program in lisp, so an
> example should suffice.
>
> I would also like to connect these templates to key-shortcuts.
>
> Any help much appreciated
>
> Tx/Alain
>
>
Hello, have a look at yasnippet.

http://code.google.com/p/yasnippet/

Work fine with python out of the box, should work also with C.

--
A + Thierry
Pub key: http://pgp.mit.edu