Hi,<br><br>As a followup to the suggestion below I have committed a prototype of filetypes for C and C++ headers to the build_system branch.  The filetype detection also checks .h and no extension files for -*-C++-*- in line one to indicate a C++ header.  Just to be annoying the C++ standard headers (as distinct from the C++ versions of the C headers which is what I looked at before) use -*- C++ -*- (extra spaces) and according to the Emacs manual there is much which can go in between the -*- es so I think I might have to look for C++ anywhere between the -*- es.  Or fall back to my original idea of C++ anywhere on the line at the risk of comments which just happen to contain C++ triggering the filetype.  Admittedly this risk is small as the search is only performed on .h or no extension files. I will think about it some more.<br>
<br>In the meantime since adding filetypes seems to be entwined in lots of areas any suggestions of things I may have missed in terms of adding these filetypes would be appreciated.<br><br>Cheers<br>Lex<br><br><div class="gmail_quote">
2008/11/10 Lex Trotman <span dir="ltr"><<a href="mailto:elextr@gmail.com">elextr@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote">2008/11/7 Lex Trotman <span dir="ltr"><<a href="mailto:elextr@gmail.com" target="_blank">elextr@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br><br><div class="gmail_quote"><div class="Ih2E3d">2008/11/7 Nick Treleaven <span dir="ltr"><<a href="mailto:nick.treleaven@btinternet.com" target="_blank">nick.treleaven@btinternet.com</a>></span><div><div></div>
<div>
<br></div></div></div><div class="Ih2E3d"><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yes, I set 2 project build commands, then checked the menu. It doesn't<br>


work after updating the dialog, but reopening the project does work.<br>
</blockquote></div><div><br>interesting, will look at it, I thought I called update_menu everywhere I needed, but must have missed somewhere </div></div></div></blockquote><div><br>Hopefully fixed now <br></div><div class="Ih2E3d">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div><br></div><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
BTW there was a bug where the 3rd project build menu item is created<br>
based on the 2nd label.<br>
<div></div></blockquote></div><div><br>Ah yes, the old copy and paste and forget to edit the names trick ;-) will fix</div></div></blockquote></div><div><br>Fixed<br><br>In planning my attack on the next phase I have come to the point where I have to to raise something I am sure has been raised before, C & C++ header filetypes.<br>

Currently using C or C++ as the filetype for headers works for highlighting (except for C++ .h files which are taken to be C, so things such as template or namespace are not highlighted).<br>Then there is a piece of hard code which disables filetype commands for *.h* files.  This can become rather messy when new commands are saved by filetype since we can't save any for header files.<br>

<br>I propose that header files become first class citizens and be given their own filetypes with specific highlighting and commands.  Detection will be easy for distinct extensions such as .hpp etc but not all compilers seem to properly support them (aside: the C++ standard can be read as only *requiring* support for a single character after the dot though not preventing multi character extensions).<br>

For .h or unnamed files I suggest extending filetypes_detect_from_file_internal() that looks for shebangs to look for "C++" anywhere in line one.  This will detect the emacs -*-C++-*- sequence or similar.  On my system at least, all the C++ standard header files have this since most do *not* have any extension (eg <iostream>) and many C++ application libraries have them too.  So this seems a reasonable approach and will of course assist Geany's replacement of Emacs as "all the worlds programmers favourite editor" ;-)<br>

For default commands for header files I propose just a compile that does a syntax check, since I seem to spend as long getting compile errors out of headers as I do bodies, making them compile before I use them would be helpful.  This of course requires different commands for C++ and C so they need to be different filetypes.<br>

<br>Have I missed some key reason for not having distinct C and C++ header filetypes (other than the detection issue)??<br><br>In reaching the above understanding I noticed that filetype.c has 'class' in its keywords, this isn't a C keyword.<br>

<br>Cheers<br>Lex<br><br><br><br></div></div><br>
</blockquote></div><br>