From unknown Fri Aug 15 15:33:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Apr 2024 17:57:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 70167@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171216697516444 (code B ref -1); Wed, 03 Apr 2024 17:57:04 +0000 Received: (at submit) by debbugs.gnu.org; 3 Apr 2024 17:56:15 +0000 Received: from localhost ([127.0.0.1]:59519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs4qN-0004H9-8C for submit@debbugs.gnu.org; Wed, 03 Apr 2024 13:56:15 -0400 Received: from lists.gnu.org ([2001:470:142::17]:52214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs4qH-0004FI-Qb for submit@debbugs.gnu.org; Wed, 03 Apr 2024 13:56:13 -0400 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 1rs4q0-0005Qu-FK for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 13:55:52 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs4pr-0001lx-P6 for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 13:55:45 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id C2E953200A7A for ; Wed, 3 Apr 2024 13:55:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 03 Apr 2024 13:55:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1712166936; x=1712253336; bh=3U6WDulx9D 0vmhHTxFQ/IxX9F1hoa7npQgQFGiaYJ4Y=; b=3BZJB69ZGW/89XP3sGTC4fbWH+ pkFbBtzR6ERIvGSxlEf68x1oevdsMjmKYq6InaxAPBbU9NUP7bDJP1jnwIbOPbWF KJ5nQyztu2DDBArs1M7sPfaSWmRMUlDAz8scxyrlryFrdskLUosbtJQgu+Bh4TZr 0zhC5WKwYWvJsdGXy2sM9Afz7DNX8OTM6vFlgby5fR+YfriZa0h73c90LmztNFcb dqU24UbklhtlasOZhEExTfnp2wQXkLjSCwjDGG4KMeRzsugcd0uun9PugtW0Qlvn kQ+vLQM+oGuBs3tD11RvSDbhrrk+HBVRZ5/Ck4Q2vMbh0eZfVPYqO/mVv8iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712166936; x=1712253336; bh=3U6WDulx9D0vmhHTxFQ/IxX9F1ho a7npQgQFGiaYJ4Y=; b=PbZw6zgY3NKwCFyLM+rbJXziYb14+qWfVuTPPEN4OAoP U0J0OAxWKtBvgrnoiNja6ddGH5Ml+iyj6Qe890YdMHZcB0Shz89GILqVfagZ9bby lwqDfZ7d3X6XCgbaj444P58bcSlIbN8QgwbmDZs5Lsk5302ah2MYq0FmNXmlYyOx wdonbAqo5yA4xMJcpoXnn3zgyGSa+JuzmXSSwRrDI3pVJ0t1APcF0+8irRXfoqkM B0VS63qgiUWLCV0CoFvhjIWMuNE3k9dKq8w/HzLn2klsCoEUiZRxUhwbxoca8lnM omgsyoqBUtrOKx6eM66184kEZRSqOXqbgzRUUrugwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtgfesthhqredttd dtjeenucfhrhhomhepjhhohhhnuchmuhhhlhcuoehjmhesphhusgdrphhinhhkqeenucgg tffrrghtthgvrhhnpeetuefhgfeuieejteekffejudettdeuueekueffkeeileekueegle efkefhgefhueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehjmhesphhusgdrphhinhhk X-ME-Proxy: Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 3 Apr 2024 13:55:35 -0400 (EDT) From: john muhl Date: Wed, 03 Apr 2024 12:55:33 -0500 Message-ID: <87sf02baay.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=64.147.123.19; envelope-from=jm@pub.pink; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Tags: patch This changes the diagnostic region end position from being guessed based on thing-at-point to using the one provided by LuaCheck. As noted in bug#67152 it was already being matched but not used. I couldn=E2=80=99t find anything where t-a-p guessed wrong but it seems preferable to just mark exactly the same region as LuaCheck would. From unknown Fri Aug 15 15:33:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Apr 2024 18:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 70167@debbugs.gnu.org Received: via spool by 70167-submit@debbugs.gnu.org id=B70167.171216770420480 (code B ref 70167); Wed, 03 Apr 2024 18:09:02 +0000 Received: (at 70167) by debbugs.gnu.org; 3 Apr 2024 18:08:24 +0000 Received: from localhost ([127.0.0.1]:59530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs527-0005KG-P9 for submit@debbugs.gnu.org; Wed, 03 Apr 2024 14:08:24 -0400 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:49601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs523-0005K0-HM for 70167@debbugs.gnu.org; Wed, 03 Apr 2024 14:08:21 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 250A92B0024C for <70167@debbugs.gnu.org>; Wed, 3 Apr 2024 14:08:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 03 Apr 2024 14:08:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712167687; x=1712174887; bh=zq5/mlneVS I2hqKoP7MmpXakrU0CfRtHaAt6/roPn40=; b=uv6V/X24G09SBeVa8RW2HNB7mb xPIUfnpjmriCYv2gnaWWLln1M1Qa8JX1LIstlPNakJB0bim8AFD+DWpyBShEKZea a4q+wrQyEVZRCaUVHJ0THNkQIykeYd0YAIv3gVM5rfCsyTFd+AmWxtJlLnYC1i+k kwwIPqKfZN+qTjVhdpcpfQ17jrDwoy4KbZnIbM2Lg/s8kSgX/W3IwaMjsN77mzkG DEj8w1MUz0E2SMCuxFOdFR2lHOiJV9c1yQ5twF0oiEEyVvsO1+pL/sa3AQJhBk4f Bqe9MfArOv3BhoXfPPhNtySiRxPuqCOGaDdO+LAsuqdT8V5NMgxdrinUtv8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712167687; x=1712174887; bh=zq5/mlneVSI2hqKoP7MmpXakrU0C fRtHaAt6/roPn40=; b=Lb8IcpAzgt6kQyrqIPlOI5Y1aJaufGzJfxrLo0SdIuUh F2bo+nBUEc+V/ekeY4snVYQ3bmhMHiKzkEcUNC5sBIM+CZuoSoiQGVYuQnIRqVNw eVkbc1H2KRjhJ/kIFuqeFh3qY+1psvkwjSoWYdIUMGL2c4R66dfy3i5z/IGkOLZ/ xw0vefLOSpRX/s/6uEDBaG2DsIl7n6pCVoK+vGcU5sruNTJdTc6BFsiSCTLU7TZN /Z4w7L+bAwCDAa5oNVsq8vsrKcviSPhvKPMsy02WwYwrMMfObWB5gCQnDw1vui+X MAkALtziXPyzklXjbhZ5eyy/8GIJIwBWDU4Wtq94FQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgovehorghsthgrlhdqffegtdefqddtheculdeftd dtmdenucfjughrpehffgfhvffuffgjkfggtgguseertdertddtredtnecuhfhrohhmpehj ohhhnhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggftrfgrthhtvghrnhepge ehiedvgeekhedugedtveefffeihedtgeehfeetieejvdeffefgffehffehheejnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhmsehpuhgsrd hpihhnkh X-ME-Proxy: Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70167@debbugs.gnu.org>; Wed, 3 Apr 2024 14:08:07 -0400 (EDT) References: <87sf02baay.fsf@pub.pink> User-agent: mu4e 1.10.8; emacs 30.0.50 From: john muhl Date: Wed, 03 Apr 2024 12:59:24 -0500 In-reply-to: Message-ID: <878r1ub9q1.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Mark-Flymake-regions-more-accurately-in-lua-ts-mode.patch X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >From a0c1f9c84a7072a807141f7b304a3c98c8e92173 Mon Sep 17 00:00:00 2001 From: john muhl Date: Wed, 13 Mar 2024 08:35:08 -0500 Subject: [PATCH] Mark Flymake regions more accurately in lua-ts-mode * lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use the end position provided by Luacheck rather than relying on 'thing-at-point' to guess where the end should be. (bug#70167) --- lisp/progmodes/lua-ts-mode.el | 55 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 407ef230c32..a39cfa9e814 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -35,7 +35,6 @@ (require 'treesit) (eval-when-compile - (require 'cl-lib) (require 'rx)) (declare-function treesit-induce-sparse-tree "treesit.c") @@ -544,32 +543,34 @@ lua-ts-flymake-luacheck (eq proc lua-ts--flymake-process)) (with-current-buffer (process-buffer proc) (goto-char (point-min)) - (cl-loop - while (search-forward-regexp - (rx (seq bol - (0+ alnum) ":" - (group (1+ digit)) ":" - (group (1+ digit)) "-" - (group (1+ digit)) ": " - (group (0+ nonl)) - eol)) - nil t) - for (beg . end) = (flymake-diag-region - source - (string-to-number (match-string 1)) - (string-to-number (match-string 2))) - for msg = (match-string 4) - for type = (if (string-match "^(W" msg) - :warning - :error) - when (and beg end) - collect (flymake-make-diagnostic source - beg - end - type - msg) - into diags - finally (funcall report-fn diags))) + (let (beg end msg type diags) + (while + (search-forward-regexp + (rx (: bol (0+ alnum) ":" + (group (1+ digit)) ":" + (group (1+ digit)) "-" + (group (1+ digit)) ": " + (group (0+ nonl)) eol)) + nil t) + (setq beg + (car (flymake-diag-region + source + (string-to-number (match-string 1)) + (string-to-number (match-string 2))))) + (setq end + (cdr (flymake-diag-region + source + (string-to-number (match-string 1)) + (string-to-number (match-string 3))))) + (setq msg (match-string 4)) + (setq type (if (string-match "^(W" msg) :warning + :error)) + (when (and beg end) + (setq diags + (nconc diags + (list (flymake-make-diagnostic + source beg end type msg)))))) + (funcall report-fn diags))) (flymake-log :warning "Canceling obsolete check %s" proc)) (kill-buffer (process-buffer proc))))))) (process-send-region lua-ts--flymake-process (point-min) (point-max)) -- 2.41.0 From unknown Fri Aug 15 15:33:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Apr 2024 06:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: john muhl Cc: 70167@debbugs.gnu.org Received: via spool by 70167-submit@debbugs.gnu.org id=B70167.17122107473039 (code B ref 70167); Thu, 04 Apr 2024 06:06:02 +0000 Received: (at 70167) by debbugs.gnu.org; 4 Apr 2024 06:05:47 +0000 Received: from localhost ([127.0.0.1]:60249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsGEM-0000mu-G1 for submit@debbugs.gnu.org; Thu, 04 Apr 2024 02:05:47 -0400 Received: from mout02.posteo.de ([185.67.36.66]:37005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsGEJ-0000lw-AI for 70167@debbugs.gnu.org; Thu, 04 Apr 2024 02:05:45 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7DEE5240101 for <70167@debbugs.gnu.org>; Thu, 4 Apr 2024 08:05:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712210732; bh=lbOCT8V7gmwhkIxCkictZFkATA9rK2cxP3diCHnUbYE=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=JQrk3fQvnR6WS+kqgGdwnMIAKqsgQ8sNiqCnQI69bVc465QB5tn5p9q5m+ETSlyql DNoWNzHeknaH/e6db/czRWhP+udtOdlrJYl8TWeBWFCs7iguWqHo5GZhavg71Z2ey4 xbcTuy6cnZCeNMO1hkyK/ofItwee+NorF/FQfD2xHnA3t0eaRM6Rk3gvVjccu+YnTK z2SivGYM/nYMHTsHcFB2OH+cm1TbmBnXa02O8nOrHcubQapdDJjPOVksdNbaU/MNNx GrlMacX3/lFZMCd0yFRKwDe4KzFv/Jh944eKkP/UdvAkKV3lVZ0YobpRh7ww4Sr4nu RAw5g5j1LRvKQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V9B1F0ryDz6tyS; Thu, 4 Apr 2024 08:05:20 +0200 (CEST) From: Philip Kaludercic In-Reply-To: <878r1ub9q1.fsf@pub.pink> (john muhl's message of "Wed, 03 Apr 2024 12:59:24 -0500") References: <87sf02baay.fsf@pub.pink> <878r1ub9q1.fsf@pub.pink> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Thu, 04 Apr 2024 06:05:03 +0000 Message-ID: <87jzldek8g.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) john muhl writes: >>>From a0c1f9c84a7072a807141f7b304a3c98c8e92173 Mon Sep 17 00:00:00 2001 > From: john muhl > Date: Wed, 13 Mar 2024 08:35:08 -0500 > Subject: [PATCH] Mark Flymake regions more accurately in lua-ts-mode > > * lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use > the end position provided by Luacheck rather than relying on > 'thing-at-point' to guess where the end should be. (bug#70167) > --- > lisp/progmodes/lua-ts-mode.el | 55 ++++++++++++++++++----------------- > 1 file changed, 28 insertions(+), 27 deletions(-) > > diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el > index 407ef230c32..a39cfa9e814 100644 > --- a/lisp/progmodes/lua-ts-mode.el > +++ b/lisp/progmodes/lua-ts-mode.el > @@ -35,7 +35,6 @@ > (require 'treesit) > > (eval-when-compile > - (require 'cl-lib) > (require 'rx)) > > (declare-function treesit-induce-sparse-tree "treesit.c") > @@ -544,32 +543,34 @@ lua-ts-flymake-luacheck > (eq proc lua-ts--flymake-process)) > (with-current-buffer (process-buffer proc) > (goto-char (point-min)) > - (cl-loop > - while (search-forward-regexp > - (rx (seq bol > - (0+ alnum) ":" > - (group (1+ digit)) ":" > - (group (1+ digit)) "-" > - (group (1+ digit)) ": " > - (group (0+ nonl)) > - eol)) > - nil t) > - for (beg . end) = (flymake-diag-region > - source > - (string-to-number (match-string 1)) > - (string-to-number (match-string 2))) > - for msg = (match-string 4) > - for type = (if (string-match "^(W" msg) > - :warning > - :error) > - when (and beg end) > - collect (flymake-make-diagnostic source > - beg > - end > - type > - msg) > - into diags > - finally (funcall report-fn diags))) > + (let (beg end msg type diags) > + (while Why do you declare these variables outside of the loop? Should the values persist between iterations? If not, you could avoid the setq soup below, by declaring and binding the variables at once. > + (search-forward-regexp > + (rx (: bol (0+ alnum) ":" ^ this is not necessary, since the rx body has an implicit ":". > + (group (1+ digit)) ":" > + (group (1+ digit)) "-" > + (group (1+ digit)) ": " > + (group (0+ nonl)) eol)) > + nil t) > + (setq beg > + (car (flymake-diag-region > + source > + (string-to-number (match-string 1)) > + (string-to-number (match-string 2))))) > + (setq end > + (cdr (flymake-diag-region > + source > + (string-to-number (match-string 1)) > + (string-to-number (match-string 3))))) > + (setq msg (match-string 4)) > + (setq type (if (string-match "^(W" msg) :warning ^ You can avoid a regular expression here using `string-prefix-p'. > + :error)) > + (when (and beg end) > + (setq diags > + (nconc diags > + (list (flymake-make-diagnostic > + source beg end type msg)))))) > + (funcall report-fn diags))) If I see this correctly, then you are appending each element to the end of the list? If so, it would be more efficient to just construct the list in reverse using `push' and then `nreverse'ing it before passing it to REPORT-FN. > (flymake-log :warning "Canceling obsolete check %s" proc)) > (kill-buffer (process-buffer proc))))))) > (process-send-region lua-ts--flymake-process (point-min) (point-max)) -- Philip Kaludercic on peregrine From unknown Fri Aug 15 15:33:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Apr 2024 06:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: john muhl Cc: 70167@debbugs.gnu.org Received: via spool by 70167-submit@debbugs.gnu.org id=B70167.17122107673106 (code B ref 70167); Thu, 04 Apr 2024 06:07:01 +0000 Received: (at 70167) by debbugs.gnu.org; 4 Apr 2024 06:06:07 +0000 Received: from localhost ([127.0.0.1]:60254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsGEg-0000o2-JS for submit@debbugs.gnu.org; Thu, 04 Apr 2024 02:06:07 -0400 Received: from mout01.posteo.de ([185.67.36.65]:52289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsGEb-0000nC-Fe for 70167@debbugs.gnu.org; Thu, 04 Apr 2024 02:06:05 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C1C14240027 for <70167@debbugs.gnu.org>; Thu, 4 Apr 2024 08:05:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712210750; bh=lbOCT8V7gmwhkIxCkictZFkATA9rK2cxP3diCHnUbYE=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=YTayhjn4AfHitmXku1b8fZ0k0glBcYqsnFNbCjV/GouomCvRRwW31etKFLzFApvEv DqOrmpkK/AMWsujPWgNHhzku/7n1qsdynBRxLkTSaYVQnCx71rAfoiAs0hPXBFz8HJ aFlgeTlWs3Zj9LIngAVMnhGUzS4o306V3jb+wm4oabM3GPJlOWrhqhDaXORN0c0/xC 3p57UmGhY2Inkc1x6xLmmIoaI5AujYrdhSgMi2hZKQp8SWaJwPg1jXJJThbWmSY9sf xh7GvCvHwcKBJRq5sUv+17MYhstIeFdIGM/0E04sxjN7+LXj2E15HQB5wLhtnyclF5 VvN96GWdBqMiQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V9B1p29DLz6tx2; Thu, 4 Apr 2024 08:05:50 +0200 (CEST) From: Philip Kaludercic In-Reply-To: <878r1ub9q1.fsf@pub.pink> (john muhl's message of "Wed, 03 Apr 2024 12:59:24 -0500") References: <87sf02baay.fsf@pub.pink> <878r1ub9q1.fsf@pub.pink> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Thu, 04 Apr 2024 06:05:49 +0000 Message-ID: <87il0xek76.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) john muhl writes: >>>From a0c1f9c84a7072a807141f7b304a3c98c8e92173 Mon Sep 17 00:00:00 2001 > From: john muhl > Date: Wed, 13 Mar 2024 08:35:08 -0500 > Subject: [PATCH] Mark Flymake regions more accurately in lua-ts-mode > > * lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use > the end position provided by Luacheck rather than relying on > 'thing-at-point' to guess where the end should be. (bug#70167) > --- > lisp/progmodes/lua-ts-mode.el | 55 ++++++++++++++++++----------------- > 1 file changed, 28 insertions(+), 27 deletions(-) > > diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el > index 407ef230c32..a39cfa9e814 100644 > --- a/lisp/progmodes/lua-ts-mode.el > +++ b/lisp/progmodes/lua-ts-mode.el > @@ -35,7 +35,6 @@ > (require 'treesit) > > (eval-when-compile > - (require 'cl-lib) > (require 'rx)) > > (declare-function treesit-induce-sparse-tree "treesit.c") > @@ -544,32 +543,34 @@ lua-ts-flymake-luacheck > (eq proc lua-ts--flymake-process)) > (with-current-buffer (process-buffer proc) > (goto-char (point-min)) > - (cl-loop > - while (search-forward-regexp > - (rx (seq bol > - (0+ alnum) ":" > - (group (1+ digit)) ":" > - (group (1+ digit)) "-" > - (group (1+ digit)) ": " > - (group (0+ nonl)) > - eol)) > - nil t) > - for (beg . end) = (flymake-diag-region > - source > - (string-to-number (match-string 1)) > - (string-to-number (match-string 2))) > - for msg = (match-string 4) > - for type = (if (string-match "^(W" msg) > - :warning > - :error) > - when (and beg end) > - collect (flymake-make-diagnostic source > - beg > - end > - type > - msg) > - into diags > - finally (funcall report-fn diags))) > + (let (beg end msg type diags) > + (while Why do you declare these variables outside of the loop? Should the values persist between iterations? If not, you could avoid the setq soup below, by declaring and binding the variables at once. > + (search-forward-regexp > + (rx (: bol (0+ alnum) ":" ^ this is not necessary, since the rx body has an implicit ":". > + (group (1+ digit)) ":" > + (group (1+ digit)) "-" > + (group (1+ digit)) ": " > + (group (0+ nonl)) eol)) > + nil t) > + (setq beg > + (car (flymake-diag-region > + source > + (string-to-number (match-string 1)) > + (string-to-number (match-string 2))))) > + (setq end > + (cdr (flymake-diag-region > + source > + (string-to-number (match-string 1)) > + (string-to-number (match-string 3))))) > + (setq msg (match-string 4)) > + (setq type (if (string-match "^(W" msg) :warning ^ You can avoid a regular expression here using `string-prefix-p'. > + :error)) > + (when (and beg end) > + (setq diags > + (nconc diags > + (list (flymake-make-diagnostic > + source beg end type msg)))))) > + (funcall report-fn diags))) If I see this correctly, then you are appending each element to the end of the list? If so, it would be more efficient to just construct the list in reverse using `push' and then `nreverse'ing it before passing it to REPORT-FN. > (flymake-log :warning "Canceling obsolete check %s" proc)) > (kill-buffer (process-buffer proc))))))) > (process-send-region lua-ts--flymake-process (point-min) (point-max)) -- Philip Kaludercic on peregrine From unknown Fri Aug 15 15:33:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Apr 2024 19:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Philip Kaludercic Cc: 70167@debbugs.gnu.org Received: via spool by 70167-submit@debbugs.gnu.org id=B70167.171225955115672 (code B ref 70167); Thu, 04 Apr 2024 19:40:04 +0000 Received: (at 70167) by debbugs.gnu.org; 4 Apr 2024 19:39:11 +0000 Received: from localhost ([127.0.0.1]:34729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsSvW-00044h-Ch for submit@debbugs.gnu.org; Thu, 04 Apr 2024 15:39:10 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsSvQ-00043B-Mn for 70167@debbugs.gnu.org; Thu, 04 Apr 2024 15:39:08 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2D0FC5C008B; Thu, 4 Apr 2024 15:38:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 04 Apr 2024 15:38:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712259534; x=1712345934; bh=KfXh9Kgcew uM1cpqDKr7fN4j2Rbw9mkalC5td/uLBRU=; b=Q7Xj22favnGU7cZ8fe4vgNM4Vm TA8nsvue9veQRG7P3vJU0WcL91cXOPUMDkEo9ApDLbEvwA7jeTUwXp2fNhmdL/wM 8YeJw3jRMEuSb35TlDwSKYWJ94ziXZda9FD4+KbbHOXsnPMg5udClLOqQBwlNnj2 c3yMvVsR8jkraTz5Ihy5+2NqmAMaURfvYEj3YKWHhN/w7IE9gjgVLX6gtGmlYoIW +seLrtvgCOswd052chhZsGVX5/nug1xIhxWUGWi2GjtyIVQ/q3UW//kleMA4L7ZR C2uDq5oA23tAu16BUO9gtge3pMznoENJDeNs0RaKQc/bm+fwC2tAoSQ09S/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712259534; x=1712345934; bh=KfXh9KgcewuM1cpqDKr7fN4j2Rbw 9mkalC5td/uLBRU=; b=q8IN0fH3QiTC2wyO7QszcZU0f9cJDO18razgLxIbEZ/a za+PbR8eYXQXnScr0PC35RcIpNz4Lxw9stq5bqNjCqnnk/1Ow7uxEuSrbPZolfgw US2yafxUv9kTeykV+U+dBJ1R7ih8Pt+J4Cp1Atl6OS1YlcvCi4OyH3PIYMfEM1g1 /rxxCNO87/ub3i/QjpCijHGgAREuzGw3XdVk/YXyU1OQla6fVdJ+Xu2WI1o2OXn6 byqa2uNp+NME1lg89BMH+dLwyoQJOCTrmu6Ghrapu4GxiUEFsbUbsPBr9KHVY4vh 5w0jq6n2sn4W9LQR6ZRyls1c5LRJ9On5mkX4Y2Upog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefkedgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtsehmtderredtreejnecuhfhrohhmpehjohhh nhcumhhuhhhluceojhhmsehpuhgsrdhpihhnkheqnecuggftrfgrthhtvghrnhepgfejve eflefhleelheeiieevueduhfevvdfhteegffehffekudekteeujeffuefhnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhmsehpuhgsrdhpih hnkh X-ME-Proxy: Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Apr 2024 15:38:53 -0400 (EDT) References: <87sf02baay.fsf@pub.pink> <878r1ub9q1.fsf@pub.pink> <87il0xek76.fsf@posteo.net> User-agent: mu4e 1.10.8; emacs 30.0.50 From: john muhl Date: Thu, 04 Apr 2024 11:45:05 -0500 In-reply-to: <87il0xek76.fsf@posteo.net> Message-ID: <875xwwq5o4.fsf@pub.pink> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Philip Kaludercic writes: > john muhl writes: > >> + (let (beg end msg type diags) >> + (while > > Why do you declare these variables outside of the loop? Should the > values persist between iterations? If not, you could avoid the setq > soup below, by declaring and binding the variables at once. Only the list of diagnostics is used outside the loop. I=E2=80=99ve moved the others inside the while. >> + (search-forward-regexp >> + (rx (: bol (0+ alnum) ":" > ^ > this is not necessary, since > the rx body has an implicit ":". Fixed. >> + (setq msg (match-string 4)) >> + (setq type (if (string-match "^(W" msg) = :warning > ^ > You can avoid a > regular expression > here using `string-pref= ix-p'. Fixed. >> + :error)) >> + (when (and beg end) >> + (setq diags >> + (nconc diags >> + (list (flymake-make-diagn= ostic >> + source beg end type msg)))))) >> + (funcall report-fn diags))) > > If I see this correctly, then you are appending each element to the end > of the list? If so, it would be more efficient to just construct the > list in reverse using `push' and then `nreverse'ing it before passing it > to REPORT-FN. Changed to use push. It doesn=E2=80=99t look like the order matters or did I misunderstand something? Thanks for the review. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Mark-Flymake-regions-more-accurately-in-lua-ts-mode.patch >From 910e88cf83415ae1e077fbc36560cb29fd39b666 Mon Sep 17 00:00:00 2001 From: john muhl Date: Wed, 13 Mar 2024 08:35:08 -0500 Subject: [PATCH] Mark Flymake regions more accurately in lua-ts-mode * lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use the end position provided by Luacheck rather than relying on 'thing-at-point' to guess where the end should be. (bug#70167) --- lisp/progmodes/lua-ts-mode.el | 53 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 407ef230c32..45ea8ec9a81 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -35,7 +35,6 @@ (require 'treesit) (eval-when-compile - (require 'cl-lib) (require 'rx)) (declare-function treesit-induce-sparse-tree "treesit.c") @@ -544,32 +543,32 @@ lua-ts-flymake-luacheck (eq proc lua-ts--flymake-process)) (with-current-buffer (process-buffer proc) (goto-char (point-min)) - (cl-loop - while (search-forward-regexp - (rx (seq bol - (0+ alnum) ":" - (group (1+ digit)) ":" - (group (1+ digit)) "-" - (group (1+ digit)) ": " - (group (0+ nonl)) - eol)) - nil t) - for (beg . end) = (flymake-diag-region - source - (string-to-number (match-string 1)) - (string-to-number (match-string 2))) - for msg = (match-string 4) - for type = (if (string-match "^(W" msg) - :warning - :error) - when (and beg end) - collect (flymake-make-diagnostic source - beg - end - type - msg) - into diags - finally (funcall report-fn diags))) + (let (diags) + (while (search-forward-regexp + (rx bol (0+ alnum) ":" + (group (1+ digit)) ":" + (group (1+ digit)) "-" + (group (1+ digit)) ": " + (group (0+ nonl)) eol) + nil t) + (let* ((beg + (car (flymake-diag-region + source + (string-to-number (match-string 1)) + (string-to-number (match-string 2))))) + (end + (cdr (flymake-diag-region + source + (string-to-number (match-string 1)) + (string-to-number (match-string 3))))) + (msg (match-string 4)) + (type (if (string-prefix-p "(W" msg) + :warning + :error))) + (push (flymake-make-diagnostic + source beg end type msg) + diags))) + (funcall report-fn diags))) (flymake-log :warning "Canceling obsolete check %s" proc)) (kill-buffer (process-buffer proc))))))) (process-send-region lua-ts--flymake-process (point-min) (point-max)) -- 2.41.0 --=-=-=-- From unknown Fri Aug 15 15:33:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2024 08:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70167 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: john muhl Cc: 70167@debbugs.gnu.org Received: via spool by 70167-submit@debbugs.gnu.org id=B70167.171273771025727 (code B ref 70167); Wed, 10 Apr 2024 08:29:03 +0000 Received: (at 70167) by debbugs.gnu.org; 10 Apr 2024 08:28:30 +0000 Received: from localhost ([127.0.0.1]:52086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruTJl-0006gt-IT for submit@debbugs.gnu.org; Wed, 10 Apr 2024 04:28:30 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruTJh-0006fv-5Z for 70167@debbugs.gnu.org; Wed, 10 Apr 2024 04:28:27 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 847F0240029 for <70167@debbugs.gnu.org>; Wed, 10 Apr 2024 10:28:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712737690; bh=zSZZcN96jilq9MtWcWm5z320j2Dp7H2UoYT/mQr/gdc=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=GSpoadTzkJFARiwauRXi5/R3N2Y4FMameNu5Oe2L0z7DYorqZKaToDpoXFZ2KHhna +wcaHMwwPrO/zqtL4j2mlAFWH9sILGcebOXmJSk/MdOgTa6ZHQJn64IIrfmyMUZ4JI u6mBEdmhxtyF9xzqhRdH9tUJ+pqT0j+TJdE1EfAp1Pq3wDgkjMT87qxxVsHmGyYsbZ T4EYdUBJ1B43UFExgIDZdURrnlTq/Ut84w+0EsgTE48KTwLFmxynKriEzkQrTf8DLG d/NOUCvkw9q9a7zlTf7rNAMIDhk6d+BLzDeY9K9tkmaasNXLEIyxtohlVKk7+RAXv7 fIhz9GTv/gk1A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VDwvF4gxFz9rxN; Wed, 10 Apr 2024 10:28:09 +0200 (CEST) From: Philip Kaludercic In-Reply-To: <875xwwq5o4.fsf@pub.pink> (john muhl's message of "Thu, 04 Apr 2024 11:45:05 -0500") References: <87sf02baay.fsf@pub.pink> <878r1ub9q1.fsf@pub.pink> <87il0xek76.fsf@posteo.net> <875xwwq5o4.fsf@pub.pink> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Wed, 10 Apr 2024 08:28:08 +0000 Message-ID: <87h6g9mxk7.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) john muhl writes: >>> + :error)) >>> + (when (and beg end) >>> + (setq diags >>> + (nconc diags >>> + (list (flymake-make-diag= nostic >>> + source beg end type msg)))))) >>> + (funcall report-fn diags))) >> >> If I see this correctly, then you are appending each element to the end >> of the list? If so, it would be more efficient to just construct the >> list in reverse using `push' and then `nreverse'ing it before passing it >> to REPORT-FN. > > Changed to use push. It doesn=E2=80=99t look like the order matters or did > I misunderstand something? It would make sense that it shouldn't matter (unless there is some subtle performance penalty in traversing the buffer in some order), so I think you can drop the nreverse. > Thanks for the review. > >>>From 910e88cf83415ae1e077fbc36560cb29fd39b666 Mon Sep 17 00:00:00 2001 > From: john muhl > Date: Wed, 13 Mar 2024 08:35:08 -0500 > Subject: [PATCH] Mark Flymake regions more accurately in lua-ts-mode > > * lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use > the end position provided by Luacheck rather than relying on > 'thing-at-point' to guess where the end should be. (bug#70167) > --- > lisp/progmodes/lua-ts-mode.el | 53 +++++++++++++++++------------------ > 1 file changed, 26 insertions(+), 27 deletions(-) > > diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el > index 407ef230c32..45ea8ec9a81 100644 > --- a/lisp/progmodes/lua-ts-mode.el > +++ b/lisp/progmodes/lua-ts-mode.el > @@ -35,7 +35,6 @@ > (require 'treesit) >=20=20 > (eval-when-compile > - (require 'cl-lib) > (require 'rx)) >=20=20 > (declare-function treesit-induce-sparse-tree "treesit.c") > @@ -544,32 +543,32 @@ lua-ts-flymake-luacheck > (eq proc lua-ts--flymake-process)) > (with-current-buffer (process-buffer proc) > (goto-char (point-min)) > - (cl-loop > - while (search-forward-regexp > - (rx (seq bol > - (0+ alnum) ":" > - (group (1+ digit)) ":" > - (group (1+ digit)) "-" > - (group (1+ digit)) ": " > - (group (0+ nonl)) > - eol)) > - nil t) > - for (beg . end) =3D (flymake-diag-region > - source > - (string-to-number (match-= string 1)) > - (string-to-number (match-= string 2))) > - for msg =3D (match-string 4) > - for type =3D (if (string-match "^(W" msg) > - :warning > - :error) > - when (and beg end) > - collect (flymake-make-diagnostic source > - beg > - end > - type > - msg) > - into diags > - finally (funcall report-fn diags))) > + (let (diags) > + (while (search-forward-regexp > + (rx bol (0+ alnum) ":" > + (group (1+ digit)) ":" > + (group (1+ digit)) "-" > + (group (1+ digit)) ": " > + (group (0+ nonl)) eol) > + nil t) > + (let* ((beg > + (car (flymake-diag-region > + source > + (string-to-number (match-st= ring 1)) > + (string-to-number (match-st= ring 2))))) > + (end > + (cdr (flymake-diag-region > + source > + (string-to-number (match-st= ring 1)) > + (string-to-number (match-st= ring 3))))) > + (msg (match-string 4)) > + (type (if (string-prefix-p "(W" ms= g) > + :warning > + :error))) > + (push (flymake-make-diagnostic > + source beg end type msg) > + diags))) > + (funcall report-fn diags))) > (flymake-log :warning "Canceling obsolete check %= s" proc)) > (kill-buffer (process-buffer proc))))))) > (process-send-region lua-ts--flymake-process (point-min) (point-ma= x)) LGTM, but I am not really a Flymake expert. --=20 Philip Kaludercic on peregrine From unknown Fri Aug 15 15:33:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: john muhl Subject: bug#70167: closed (Re: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode) Message-ID: References: <865xwlr89t.fsf@gnu.org> <87sf02baay.fsf@pub.pink> X-Gnu-PR-Message: they-closed 70167 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 70167@debbugs.gnu.org Date: Sat, 13 Apr 2024 08:13:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1712995982-1897-1" This is a multi-part message in MIME format... ------------=_1712995982-1897-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 70167@debbugs.gnu.org. --=20 70167: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D70167 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1712995982-1897-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 70167-done) by debbugs.gnu.org; 13 Apr 2024 08:12:38 +0000 Received: from localhost ([127.0.0.1]:60060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvYV3-0000QB-36 for submit@debbugs.gnu.org; Sat, 13 Apr 2024 04:12:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvYUz-0000Oi-E0 for 70167-done@debbugs.gnu.org; Sat, 13 Apr 2024 04:12:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvYUj-0000ZF-Ar; Sat, 13 Apr 2024 04:12:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=4zIVIdJTKxHLgPAyH5KQDmXrxW+UefBH/Ibtv9xaMjE=; b=R8D37VDV4URtEz5NKsZL Pkr0kxRcLHk1l1tysrLrWSUSQVwxg1cBnkItPxjHPJle9XN5ASKQatso3k67YAF4vAf9Ax2sk+BsS umBu7zbwR6DgN/vv5CCX7Y8yzH6oFXIXm07grZ7yLyEQL1TrruJLtfKK8Ud1N+xn3rkcyR8+0yNee CQOovEd3xL3toZijPCoOuDZP2DQZENV4HdIqRgpRzXpMiSzHSUztwW92It9FiesF4bwcf8zyr3vBJ ysA0qXw42CVFeFUlEK1aUQXTtKsGQvsu3QchY/O64/DL0wdU9KKCqpRjH5gkAiP5miJKi0LgtWwW1 IK7ua1JhyN/qNQ==; Date: Sat, 13 Apr 2024 11:12:14 +0300 Message-Id: <865xwlr89t.fsf@gnu.org> From: Eli Zaretskii To: john muhl In-Reply-To: <875xwwq5o4.fsf@pub.pink> (message from john muhl on Thu, 04 Apr 2024 11:45:05 -0500) Subject: Re: bug#70167: [PATCH] Mark Flymake regions more accurately in lua-ts-mode References: <87sf02baay.fsf@pub.pink> <878r1ub9q1.fsf@pub.pink> <87il0xek76.fsf@posteo.net> <875xwwq5o4.fsf@pub.pink> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70167-done Cc: philipk@posteo.net, 70167-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 70167@debbugs.gnu.org > From: john muhl > Date: Thu, 04 Apr 2024 11:45:05 -0500 > > > Changed to use push. It doesn’t look like the order matters or did > I misunderstand something? > > Thanks for the review. Thanks, I installed this on the master branch, and I'm closing the bug. ------------=_1712995982-1897-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Apr 2024 17:56:15 +0000 Received: from localhost ([127.0.0.1]:59519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs4qN-0004H9-8C for submit@debbugs.gnu.org; Wed, 03 Apr 2024 13:56:15 -0400 Received: from lists.gnu.org ([2001:470:142::17]:52214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs4qH-0004FI-Qb for submit@debbugs.gnu.org; Wed, 03 Apr 2024 13:56:13 -0400 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 1rs4q0-0005Qu-FK for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 13:55:52 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs4pr-0001lx-P6 for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2024 13:55:45 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id C2E953200A7A for ; Wed, 3 Apr 2024 13:55:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 03 Apr 2024 13:55:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1712166936; x=1712253336; bh=3U6WDulx9D 0vmhHTxFQ/IxX9F1hoa7npQgQFGiaYJ4Y=; b=3BZJB69ZGW/89XP3sGTC4fbWH+ pkFbBtzR6ERIvGSxlEf68x1oevdsMjmKYq6InaxAPBbU9NUP7bDJP1jnwIbOPbWF KJ5nQyztu2DDBArs1M7sPfaSWmRMUlDAz8scxyrlryFrdskLUosbtJQgu+Bh4TZr 0zhC5WKwYWvJsdGXy2sM9Afz7DNX8OTM6vFlgby5fR+YfriZa0h73c90LmztNFcb dqU24UbklhtlasOZhEExTfnp2wQXkLjSCwjDGG4KMeRzsugcd0uun9PugtW0Qlvn kQ+vLQM+oGuBs3tD11RvSDbhrrk+HBVRZ5/Ck4Q2vMbh0eZfVPYqO/mVv8iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712166936; x=1712253336; bh=3U6WDulx9D0vmhHTxFQ/IxX9F1ho a7npQgQFGiaYJ4Y=; b=PbZw6zgY3NKwCFyLM+rbJXziYb14+qWfVuTPPEN4OAoP U0J0OAxWKtBvgrnoiNja6ddGH5Ml+iyj6Qe890YdMHZcB0Shz89GILqVfagZ9bby lwqDfZ7d3X6XCgbaj444P58bcSlIbN8QgwbmDZs5Lsk5302ah2MYq0FmNXmlYyOx wdonbAqo5yA4xMJcpoXnn3zgyGSa+JuzmXSSwRrDI3pVJ0t1APcF0+8irRXfoqkM B0VS63qgiUWLCV0CoFvhjIWMuNE3k9dKq8w/HzLn2klsCoEUiZRxUhwbxoca8lnM omgsyoqBUtrOKx6eM66184kEZRSqOXqbgzRUUrugwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtgfesthhqredttd dtjeenucfhrhhomhepjhhohhhnuchmuhhhlhcuoehjmhesphhusgdrphhinhhkqeenucgg tffrrghtthgvrhhnpeetuefhgfeuieejteekffejudettdeuueekueffkeeileekueegle efkefhgefhueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehjmhesphhusgdrphhinhhk X-ME-Proxy: Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 3 Apr 2024 13:55:35 -0400 (EDT) From: john muhl To: bug-gnu-emacs@gnu.org Subject: [PATCH] Mark Flymake regions more accurately in lua-ts-mode Date: Wed, 03 Apr 2024 12:55:33 -0500 Message-ID: <87sf02baay.fsf@pub.pink> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=64.147.123.19; envelope-from=jm@pub.pink; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Tags: patch This changes the diagnostic region end position from being guessed based on thing-at-point to using the one provided by LuaCheck. As noted in bug#67152 it was already being matched but not used. I couldn=E2=80=99t find anything where t-a-p guessed wrong but it seems preferable to just mark exactly the same region as LuaCheck would. ------------=_1712995982-1897-1--