[Geany] Help with custom compiler

Laszlo Nagy gandalf at xxxxx
Thu Jul 19 07:38:40 UTC 2012

>> Thanks. But I still don't know how to do it. Obviously, I wouldn't like to
>> browse C source files. In fact it was about 5 years ago when I last wrote a
>> program in C, so even if I downloaded the sources, it wouldn't help.
> A quick search of the manual for regex finds
> http://www.geany.org/manual/current/#build-settings-section for how
> the regex is used

I could setup Geany so that it automatically opens files referenced from 
error messages (if they are not opened yet). It can also navigate to the 
good line number. How can I use non-capturing groups in the error 
parsing regex?

Here is an example. There are two kinds of error messages that I can get 
- because there can be an error in the compiler that I'm working on, and 
also there can be an error in the file that is being compiled:

Error message (type one):

File "/home/gandalf/Python/Lib/shopzeus/scripts/ssdlc.py", line 23, in 

Regexp (type one):

\s*File\s\"([^\"]+)\", line (\d+), in\s*(.*)

Error message (type two):


Regexp (type two):


Both of these errors can happen then I press F8, so I would like to 
capture both messages if possible.  This is what I have tried:

(?:\s*File\s\"([^\"]+)\", line (\d+), 

But it does not capture errors in the compiler. Maybe my regular 
expression is wrong. Or maybe the non-capturing group "?:" does not work.

Here are some things that don't work:

  * Cannot make a difference between warnings and errors. Now I know
    that this is a limitation of Geany and I can live with it. It would
    be a good improvement though.
  * My compiler actually can tell the column number of the error too.
    Geany cannot interpret column numbers in error messages, right? This
    could be a good improvement too. ( Should I post this as a request
    on the dev list? )
  * It is a bit off topic. When using GNU style error messages under
    Windows, parts of the error messages are ambiguous. Because the
    parts should be separated with colons, but under Windows the file
    names can contain colons too. I understand that this is a limitation
    of the GNU standard, not Geany. And I know that I could use a
    different error message format. But I'm hesitant to do it. What is
    better: follow the standard, or make it working? Is there a way to
    have both?

Otherwise, I'm quite satisfied now. :-) Thank you for your help!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20120719/9c244ba2/attachment.html>

More information about the Users mailing list