1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Make Compilation mode recognize Lua errors

Emacs comes with built-in support for the Lua programming language in
the form of the Lua mode and now also the Lua Tree-sitter mode.  This
patch further improves Lua support in Emacs by making the Compilation
mode recognize Lua errors and stack traces.

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps to aid Lua development, namely the 'lua' regexp that
matches Lua errors and the 'lua-stack' regexp that matches Lua stack
frames.  (Bug#60830)
* etc/compilation.txt (Lua): Add an example of a Lua error message
with a stack trace.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
(compile-test-error-regexps): Test the new 'lua' and 'lua-stack'
regexps added to the 'compilation-error-regexp-alist-alist'.
This commit is contained in:
Rudolf Adamkovič 2023-10-03 09:07:40 +02:00 committed by Stefan Kangas
parent 3d41239524
commit cd0eb055fd
4 changed files with 55 additions and 2 deletions

View file

@ -362,6 +362,14 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
(ruby-Test::Unit
"^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
;; Tested with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT 2.1.
(lua
"^[^\n\t]+?: \\([^\n\t]+?\\):\\([0-9]+?\\): .+\nstack traceback:\n\t"
1 2 nil 2 1)
(lua-stack
"^\t\\(?:\\[C\\]:\\|\\([^\n\t]+?\\):\\(?:\\([0-9]+?\\):\\)?\\) in "
1 2 nil 0 1)
(gmake
;; Set GNU make error messages as INFO level.
;; It starts with the name of the make program which is variable,