~technomancy/fennel

3 2

Support for Lua/Fennel errors in Emacs merged

Rudolf Adamkovič <salutis@me.com>
Details
Message ID
<m2fryucyt2.fsf@me.com>
DKIM signature
pass
Download raw message
Fellow hackers who run Emacs from the 'main' branch,

A while ago, I submitted a patch to GNU Emacs that makes the built-in
Compilation Mode recognize Lua/Fennel errors, including stack traces,
and my patch was recently merged into 'main'.  So, if you have similar
code in your '.emacs', you may want to delete it now.

Going forward, if some Fennel error is not recognized correctly by the
Compilation Mode in Emacs, we should consider patching the Fennel side
to match Lua, instead of hacking around the problem locally, or in the
Fennel mode.  From what I remember, there are a couple of places where
Fennel or Faith output something slightly different than expected.

(1) The patch:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=cd0eb055fd4ebc3f7f7f5f5617549f963fe8ecff

(2) A subsequent clean-up patch, by Mattias Engdegård:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d7d9bf1fe35e81e4bd37c326ebe569ab38043640

Rudy
-- 
"Strange as it may sound, the power of mathematics rests on its evasion
of all unnecessary thought and on its wonderful saving of mental
operations."
--- Ernst Mach, 1838-1916

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia
Details
Message ID
<875xzqq6z3.fsf@hagelb.org>
In-Reply-To
<m2fryucyt2.fsf@me.com> (view parent)
DKIM signature
pass
Download raw message
Rudolf Adamkovič <salutis@me.com> writes:

> A while ago, I submitted a patch to GNU Emacs that makes the built-in
> Compilation Mode recognize Lua/Fennel errors, including stack traces,
> and my patch was recently merged into 'main'.  So, if you have similar
> code in your '.emacs', you may want to delete it now.

Cool; thanks!

The main difference between Fennel compilation errors and Lua ones is
that Fennel errors also contain column numbers while Lua has line
numbers only. Does this support traces that have columns too?

-Phil
Rudolf Adamkovič <salutis@me.com>
Details
Message ID
<m2sf2dyb4o.fsf@me.com>
In-Reply-To
<875xzqq6z3.fsf@hagelb.org> (view parent)
DKIM signature
pass
Download raw message
Phil Hagelberg <phil@hagelb.org> writes:

> Cool; thanks!

This will be a longer journey, though, as I still cases where Fennel
outputs something NIH that does not match any standard rules, such as
GNU, nor the new Lua rules I contributed.  I will address those NIH
cases, one by one, in subsequent patches against Fennel and Faith.

> The main difference between Fennel compilation errors and Lua ones is
> that Fennel errors also contain column numbers while Lua has line
> numbers only. Does this support traces that have columns too?

I can see column numbers in compile errors, such as

  ./example.fnl:13:0 Compile error: unknown identifier: example

and these are recognized in Emacs by default.

Further, Lua runtime errors with traces, such as

  /usr/bin/lua: database.lua:31: assertion failed!
  stack traceback:
  <TAB>[C]: in function 'assert'
  <TAB>database.lua:31: in field 'statement'
  <TAB>database.lua:42: in field 'table'
  <TAB>database.lua:55: in field 'row'
  <TAB>database.lua:63: in field 'value'
  <TAB>io.lua: in main chunk
  <TAB>[C]: in ?

are now recognized too, but their traces have no column numbers.

So, I now wonder, how can I reproduce

> traces that have columns

that you asked about?

Rudy
-- 
"Music is the mathematics of the sense, mathematics is the music of the
reason."  --- James Joseph Sylvester, 1814-1897

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia
Details
Message ID
<871q9wjd8m.fsf@hagelb.org>
In-Reply-To
<m2sf2dyb4o.fsf@me.com> (view parent)
DKIM signature
pass
Download raw message
Rudolf Adamkovič <salutis@me.com> writes:

> This will be a longer journey, though, as I still cases where Fennel
> outputs something NIH that does not match any standard rules, such as
> GNU, nor the new Lua rules I contributed.  I will address those NIH
> cases, one by one, in subsequent patches against Fennel and Faith.

Looking forward to it.

> So, I now wonder, how can I reproduce
>
>> traces that have columns
>
> that you asked about?

Sorry; I misspoke. I said "traces" when I meant compilation
errors. Sounds like it's handled now, which is great.

thanks,
Phil
Reply to thread Export thread (mbox)