Subject: bug#60830: 30.0.50; The *Compilation* buffer does not recognize Lua errors

From: Mattias Engdegård <[email-masked]>
Date: Sun, 8 Oct 2023 11:59:18 +0200

7 okt. 2023 kl. 23.02 skrev Rudolf Adamkovič <[email-masked]>:

> (1) How can I specify "this group cannot be '[C]'" in the regexp?

Disallow files starting with a left square bracket?

> (2) How can I test this scenario in 'compile-tests.el'?

We can help out.

> I made the relevant groups greedy, but I wonder what difference it
> makes.

Only use non-greedy operators if they make the regexp significantly easier to express. Greedy should be the default.
Non-greedy operators are usually less efficient, and always raise eyebrows when read: why is this non-greedy?

Writing ".*?\n", as you did, makes no sense at all since "." will match anything except newline, and the result is identical to ".*\n" but less readable and maybe slower.

>> We try to make rules work with Windows file names (or names containing
>> spaces, which are also somewhat common on Windows) where relevant and
>> practical. Your patterns don't; can you argue that it's not useful for
>> Lua or not possible to do so?
> 
> Good catch!  Fixed.

Maybe you should test it just in case. (You don't need a Windows machine to do that but it adds authenticity).

> I would understand if we did that for some long-dead compilers but not
> for Lua.

Look, it's not a beauty contest. We'll do what we have to.

> We still detect the file path/name, which is useful.

The point is that it substantially increases the risks of false matches. Lua needs to be a good neighbour and can't just think of its own needs over anything else.