From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60830: 30.0.50; The *Compilation* buffer does not recognize Lua errors Date: Tue, 03 Oct 2023 10:12:05 +0200 Message-ID: References: Reply-To: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7569"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 60830@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 03 10:13:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qnaWq-0001d4-E3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Oct 2023 10:13:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnaWO-00015i-Eu; Tue, 03 Oct 2023 04:12:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnaWK-00014e-VY for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2023 04:12:44 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qnaWK-0005Nx-Mn for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2023 04:12:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qnaWb-0001UW-NE for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2023 04:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Oct 2023 08:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60830 X-GNU-PR-Package: emacs Original-Received: via spool by 60830-submit@debbugs.gnu.org id=B60830.16963207555693 (code B ref 60830); Tue, 03 Oct 2023 08:13:01 +0000 Original-Received: (at 60830) by debbugs.gnu.org; 3 Oct 2023 08:12:35 +0000 Original-Received: from localhost ([127.0.0.1]:38666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnaWA-0001Tl-PW for submit@debbugs.gnu.org; Tue, 03 Oct 2023 04:12:35 -0400 Original-Received: from mr85p00im-zteg06022001.me.com ([17.58.23.193]:33680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnaW8-0001TV-Uq for 60830@debbugs.gnu.org; Tue, 03 Oct 2023 04:12:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1696320730; bh=Bz9nBbGkR2f45VsJg94R4FQhhJ+0fY9EANDZyBVeLyY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JvdvGkuVZgusc/720yMMBN6YpqcfXsZ9enrXkV7BxqAXKRv+fgv5BEEgEiQgiosg1 8ZU5IBYoVDsTafsShmNJWSCks9UhIH+inJ+cgpPLEq9NMEnamsW20LV3OmiXAF8nXI 34Qf3gc32i2DCMmbnxC8Y5nfeDx2vQHiyNQXdbFAyu1m4qpqShemn8xRMdzG0mJXZE u4TYGJKwubZPmYjl9Ur2XnpHZrlNryk4nwdTzhhOhezmokOzPck0jIIh1J8zxVl2/f wWKGnLwK0JHifVf0Xg1XB9yROLpfFnI22aiQYjxwvOzAP0eA1+cEWILutAdIppZbeT wSF7ZGWpnsgGA== Original-Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-zteg06022001.me.com (Postfix) with ESMTPSA id 085698001E3; Tue, 3 Oct 2023 08:12:08 +0000 (UTC) In-Reply-To: X-Proofpoint-ORIG-GUID: WYK5RfAiNCBZIKpaQ5UYRzfBmwE97JBE X-Proofpoint-GUID: WYK5RfAiNCBZIKpaQ5UYRzfBmwE97JBE X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.425, 18.0.572, 17.0.605.474.0000000 definitions=2022-01-14_01:2022-01-14_01, 2020-02-14_11, 2020-01-23_02 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxlogscore=915 phishscore=0 clxscore=1015 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2310030056 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271697 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > [...], all that is needed is to fix the formatting you describe in > (1). That will give the desired behavior. [...] Regarding (2), I think > compilation-mode already detects those as file locations, with no > changes. At least it does on current master. As for (2), I recompiled Emacs from 'master' (498d31e9f05) to verify your claim, but it does seem to hold. I can reproduce the bug under 'emacs -Q' by following the reproduction steps. However! I did some thinking and realized two important facts: (A) Even if the GNU standard supported tab-indented errors, as per (2), it would not help, as Lua stack frames are not errors. (B) People use older Lua versions, which will work forever, as they are written in ANSI C, and so even if (1) is fixed upstream, we must support the current error format as well. After I realized that (A) and (B) are true, I used my morning to write a patch that solves the problem properly. I am attaching the patch to this message. Do you think the patch could be merged upstream? Thank you for your time! Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-the-Compilation-mode-recognize-Lua-errors.patch >From 3bbf4019df45548d1286ba9b0dffe8fadad2bdf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Tue, 3 Oct 2023 09:07:40 +0200 Subject: [PATCH] Make the 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. But, Lua support in Emacs is incomplete in that the Compilation mode does not recognize Lua errors, which is what this patch fixes. Reported as bug#60830. * 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. * 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'. --- lisp/progmodes/compile.el | 5 +++++ test/lisp/progmodes/compile-tests.el | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f85cc0909dd..82f8280d76d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -362,6 +362,11 @@ compilation-error-regexp-alist-alist (ruby-Test::Unit "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2) + (lua + "^[^: \n\t]+: \\([^: \n\t]+\\):\\([0-9]+\\): " 1 2 nil 2 1) + (lua-stack + "^\t\\([^: \n\t]+\\):\\([0-9]+\\): " 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, diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 078eef36774..889b3443993 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -208,6 +208,15 @@ compile-tests--test-regexps-data 1 0 31 "/usr/include/c++/3.3/backward/iostream.h") (gcc-include " from test_clt.cc:1:" 1 nil 1 "test_clt.cc") + ;; Lua + (lua "lua: database.lua:10: assertion failed!" + 6 nil 10 "database.lua") + (lua "/usr/local/bin/lua: core/database.lua:20: assertion failed!" + 21 nil 20 "core/database.lua") + (lua-stack " database.lua:10: in field 'statement'" + 2 nil 10 "database.lua" 0) + (lua-stack " core/database.lua:20: in field 'statement'" + 2 nil 20 "core/database.lua" 0) ;; gmake (gmake "make: *** [Makefile:20: all] Error 2" 12 nil 20 "Makefile" 0) (gmake "make[4]: *** [sub/make.mk:19: all] Error 127" 15 nil 19 @@ -499,9 +508,9 @@ compile-test-error-regexps (compilation-num-warnings-found 0) (compilation-num-infos-found 0)) (mapc #'compile--test-error-line compile-tests--test-regexps-data) - (should (eq compilation-num-errors-found 100)) + (should (eq compilation-num-errors-found 102)) (should (eq compilation-num-warnings-found 35)) - (should (eq compilation-num-infos-found 28))))) + (should (eq compilation-num-infos-found 30))))) (ert-deftest compile-test-grep-regexps () "Test the `grep-regexp-alist' regexps. -- 2.37.1 (Apple Git-137.1) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "Chop your own wood and it will warm you twice." -- Henry Ford; Francis Kinloch, 1819; Henry David Thoreau, 1854 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--