[Geany-devel] Committed Project Build Commands to build-system branch

Lex Trotman elextr at xxxxx
Mon Nov 10 03:10:04 UTC 2008


2008/11/7 Lex Trotman <elextr at gmail.com>

>
>
> 2008/11/7 Nick Treleaven <nick.treleaven at btinternet.com>
>
> Yes, I set 2 project build commands, then checked the menu. It doesn't
>> work after updating the dialog, but reopening the project does work.
>>
>
> interesting, will look at it, I thought I called update_menu everywhere I
> needed, but must have missed somewhere
>

Hopefully fixed now

>
>
>> BTW there was a bug where the 3rd project build menu item is created
>> based on the 2nd label.
>>
>
> Ah yes, the old copy and paste and forget to edit the names trick ;-) will
> fix
>

Fixed

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

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).
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" ;-)
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.

Have I missed some key reason for not having distinct C and C++ header
filetypes (other than the detection issue)??

In reaching the above understanding I noticed that filetype.c has 'class' in
its keywords, this isn't a C keyword.

Cheers
Lex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20081110/a3b03ca0/attachment.html>


More information about the Devel mailing list