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

From: Rudolf Adamkovič <[email-masked]>
Date: Tue, 03 Oct 2023 22:03:10 +0200

Stefan Kangas <[email-masked]> writes:

>> (A) Even if the GNU standard supported tab-indented errors, as per (2),
>> it would not help, as Lua stack frames are not errors.
>
> Yes, I noticed that too.  Is it a regression with regards to earlier
> versions of Emacs?

I was unclear in what I wrote.  Let me clarify.

What I meant is that every Lua error is followed by a stack trace
indented with a tab character.  From the point of view of a Compilation
buffer, each such Lua error consists of exactly one *error* and sequence
of stack frames, each of which is an *info*.

Note that my patch handles all this correctly, and the tests exercise
both cases, errors and stack frames, and they exercise each case twice,
once with different data, to make sure all works now and in the future.

> I see the benefit of doing that, but I wouldn't say it so strongly that
> we "must" do it.  We could also just say that people that want these
> errors detected should upgrade lua.  Note that people would also need to
> upgrade Emacs, to get this support.

It was a "mathematical" must, as in "we must find X such that..." :)

As for upgrading Lua, please know that Lua is different from other
languages in that it introduces breaking changes even between minor
versions.  This does not break all Lua projects because the language is
nothing but a single ANSI C compilation unit [*] that will work
forever. In practice, if a Lua project has zero dependencies, or perhaps
only a few, the maintainers do not ever need to upgrade Lua.  This is a
key feature of Lua, not a bug.  Thus, if Emacs wants to serve Lua
developers well, it must recognize errors from older Lua versions as
well.

[*] When compiled via the 'one.c', otherwise it is multiple files.

Rudy
-- 
"Programming reliably -- must be an activity of an undeniably
mathematical nature […] You see, mathematics is about thinking, and
doing mathematics is always trying to think as well as possible."
-- Edsger W. Dijkstra, 1981

Rudolf Adamkovič <[email-masked]> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia