[Geany-devel] C/C++ Header filetypes / templates

Nick Treleaven nick.treleaven at xxxxx
Wed Nov 12 13:24:03 UTC 2008

Just to reply to the quick points:

On Wed, 12 Nov 2008 14:23:47 +1100
"Lex Trotman" <elextr at gmail.com> wrote:

> > > Having separate C++ header templates with the mark already in it
> > > would help users to remember to add it.  BTW it would be good to
> > > have
> >
> > I don't think we should encourage people to make C++ header files
> > with a .h extension, they should use an extension unique to C++.
> >
> I entirely agree!! Unfortunately a couple of old compilers don't and
> there is lots of code out there using .h files.  I blame Stroustrup,
> who only uses .h for headers throughout his book, even though he
> acknowledges .cpp .cxx etc.

OK, but I don't think any default templates that come with Geany should
need the C++ comment mark.

> > BTW with custom file templates you can have as many templates as you
> > like for the same filetype, so you could have header.hpp,
> > source.cpp, etc template files.
> >
> Can those templates be delivered with Geany? For something fairly
> fundamental it shouldn't require every user to configure it.

Basically this needs some work, but will get done some time. But the
point is that custom file templates support is already implemented, so
this isn't another reason to add header filetypes.

> > > In terms of using make object, the .h doesn't compile to a .o
> > > file so thats no good, and I have to admit I don't quite see how
> > > make could
> >
> > I meant when you have a foo.h file and a foo.c file, you can use
> > Make Object on the foo.h file.
> >
> I still don't understand how this compiles the .h only, sorry for
> being obtuse.

It doesn't, it compiles the .o, but (when you have foo.c) it
catches any errors in the header.

> > This would cause more code to maintain, and more checks for header
> > filetypes as well as the source file filetypes.
> Surprisingly little code, Geany is pretty well structured but there
> are some hacks needed where filetype checks are hard coded.

I think it is significantly more for maintenance/writing new


More information about the Devel mailing list