[Geany] Help with custom compiler

Lex Trotman elextr at xxxxx
Thu Jul 19 06:19:58 UTC 2012


On 19 July 2012 15:52, Matthew Brush <mbrush at codebrainz.ca> wrote:
> On 12-07-18 10:32 PM, Laszlo Nagy wrote:
>>
>>
>>>>   * How to distinguish errors from warnings? I was reading the
>>>>     [build-menu] but I could only find some examples. It was not clear
>>>>     how to do it.
>>>
>>>
>>> You can write a regex for what you need in the "Error regular
>>> expression" text box in the Build Commands configuration. I think you
>>> can also store the regexp in the `filetype.yourlanguage` file.
>>>
>>> Docs:
>>> http://www.geany.org/manual/current/index.html#build-menu-configuration
>>
>> Yes, I was aware of this. As I said, *i was reading the [build-menu]*.
>> The question was: how to distinguish errors from warnings and notices? I
>> would like Geany to display errors in red, warnings in blue and notices
>> in green. Is that possible? Unfortunately, the link you sent says
>> nothing about this.
>>
>> I have also read
>> http://www.geany.org/manual/hacking.html#error-message-parsing which says:
>>
>>> New-style error message parsing is done with an extended GNU-style
>>> regex stored in the filetypes.foo file - see the [build_settings]
>>> information in the manual for details.
>>
>>
>> But it is not very helpful, since the manual on [build_settings] does
>> not tell how to do it. (Or maybe there are two versions of that
>> documentation and I'm looking at the wrong place?)
>>
>
> It looks like there's a lot of hardcoded stuff in `msgwindow.c`.

Hi Matthew,

Yeah, history was that Geany originally had coded recognition of
"standard" error messages from a few "well known" compilers, but those
tricky compiler writers either were non-standard (clang and its ^) or
changed their message formats between versions (hi Python) so regexen
were introduced to allow users to tailor the recognition without
programming, but the old method was left for users who couldn't/didn't
want to change the regexes.

Cheers
Lex

>
> Some of these functions look relevant on a quick scan:
>
> * msgwindow.c:801: parse_compiler_error_line()
> * msgwindow.c:248: get_color()
> * msgwindow.c:1189: show_build_result_message()
>
> I'm not really too familiar with that code though, so maybe there is an
> easier way than hacking the source.
>
> Cheers,
> Matthew Brush
>
>
>
> _______________________________________________
> Geany mailing list
> Geany at uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany



More information about the Users mailing list