unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: 60830@debbugs.gnu.org, Stefan Kangas <stefankangas@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#60830: 30.0.50; The *Compilation* buffer does not recognize Lua errors
Date: Fri, 6 Oct 2023 13:38:37 +0200	[thread overview]
Message-ID: <4996E536-72CE-4E6A-9C75-CF7307A82469@gmail.com> (raw)
In-Reply-To: <m25y3lyr9t.fsf@me.com>

5 okt. 2023 kl. 18.21 skrev Rudolf Adamkovič <salutis@me.com>:

> So, I studied 'luaL_traceback' in 'lauxlib.c' in Lua and
> made the regular expression more precise.  No more mis-classification!

That's the spirit!

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

Your rules incorrectly match "[C]" as a file name. This isn't just a matter of aesthetics; the user must be able to step through matches without tripping.

As to your implementation:

>     (lua
>      "^[^:\n\t]+: \\([^: \n\t]+\\):\\([0-9]+\\): .*?\nstack traceback:\n\t"
>      1 2 nil 2 1)
>     (lua-stack
>      "^\t\\([^:\n\t]+\\):\\(\\([0-9]+\\):\\)? in "
>      1 3 nil 0 1)

I see no reason for the non-greedy match in the first regexp, do you?

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?

Don't keep capture groups that you don't use. (If you use rx then you don't have to think about it. If you don't, I'm probably going to translate your regexp to rx anyway.)

I'm still erring on having these rules disabled by default because they seem very close to unrelated compiler output. Would that be a major inconvenience?

> While on it, I also added support for stack frames with no line
> number, as per Lua source code.

That doesn't result in anything useful as far as I can tell.

>  Lastly, I added a NEWS entry, as well
> as, improved the commit message a bit.

Please include an addition to etc/compilation.txt as well.






  reply	other threads:[~2023-10-06 11:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 11:33 bug#60830: 30.0.50; The *Compilation* buffer does not recognize Lua errors Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 14:55 ` Stefan Kangas
2023-10-02 12:04   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-02 18:37     ` Stefan Kangas
2023-10-03  8:12       ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-03  9:37         ` Stefan Kangas
2023-10-03 20:03           ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05 11:27         ` Mattias Engdegård
2023-10-05 16:21           ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 11:38             ` Mattias Engdegård [this message]
2023-10-06 13:21               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 14:00                 ` Mattias Engdegård
2023-10-06 14:47                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 16:20                     ` Mattias Engdegård
2023-10-06 16:49                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-07 11:18                         ` Mattias Engdegård
2023-10-07 15:22                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 10:45                             ` Mattias Engdegård
2023-10-08 14:47                               ` Mattias Engdegård
2023-10-07 21:02               ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08  9:59                 ` Mattias Engdegård
2023-10-12  8:12                   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12  8:17                     ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12 14:32                     ` Mattias Engdegård
2023-12-10 22:53                       ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10 13:48                         ` Stefan Kangas
2024-01-10 16:37                           ` Mattias Engdegård
2024-01-10 17:09                             ` Stefan Kangas
2024-01-10 17:45                               ` Mattias Engdegård
2023-10-08 15:49                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12  8:14                   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4996E536-72CE-4E6A-9C75-CF7307A82469@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=60830@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=salutis@me.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).