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

Lex Trotman elextr at xxxxx
Wed Nov 12 13:57:22 UTC 2008

Nick, I was up late watching the late movie, so here's a quick agreement.

2008/11/13 Nick Treleaven <nick.treleaven at btinternet.com>

> 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.

Yeah if the delivered header templates were only for .hpp they wouldn't need
it.  I guess the C++ mark just needs to be clearly documented for those
cases where a C++ .h already exists or is forced by external circumstance.
Saw your comment on removing filetype templates on another post, sounds like
a clean solution.  Delivering data files makes it easy for users to tinker
and saves you code maintenance.

> > > 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.

Of course not, templates is completely separate from the header file
operation problem.  Thats why I left it down here.

> > > > 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.

Oh, Ok, but then I get all the cascade errors in the .cpp file caused by the
errors in the .hpp file, the idea is to compile the header first before
using it.  I need to do that not only on initial creation but on changes
during debugging, adding functionality etc.  Basically any time I modify the
hpp file significantly.  Lets see what we can come up with IRO the main

> > > 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.

Take this comment as the complement it was meant to be.  I am not intending
to tell you how much work to take on as a maintainer.

> I think it is significantly more for maintenance/writing new
> features.
> Regards,
> Nick
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20081113/262f0241/attachment.html>

More information about the Devel mailing list