From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jm--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67152: [PATCH] Fix flymake integration in lua-ts-mode Date: Tue, 14 Nov 2023 18:08:28 +0000 Message-ID: <1ed27e2fe45fc117376415bb1a2dbffcb8f69903@pub.pink> References: <583004a793d54e48e65df38209bace3b6932c98b@pub.pink> <83wmuks9rq.fsf@gnu.org> Reply-To: jm@pub.pink Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26297"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67152@debbugs.gnu.org To: "=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=" , "Eli Zaretskii" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 14 19:09:49 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 1r2xrB-0006cP-4l for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Nov 2023 19:09:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2xqj-0001Ue-Jz; Tue, 14 Nov 2023 13:09:21 -0500 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 1r2xqi-0001U4-1E for bug-gnu-emacs@gnu.org; Tue, 14 Nov 2023 13:09:20 -0500 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 1r2xqh-0001vK-P8 for bug-gnu-emacs@gnu.org; Tue, 14 Nov 2023 13:09:19 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2xrN-0003gO-Mj for bug-gnu-emacs@gnu.org; Tue, 14 Nov 2023 13:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: jm@pub.pink Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Nov 2023 18:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67152 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67152-submit@debbugs.gnu.org id=B67152.169998535814102 (code B ref 67152); Tue, 14 Nov 2023 18:10:01 +0000 Original-Received: (at 67152) by debbugs.gnu.org; 14 Nov 2023 18:09:18 +0000 Original-Received: from localhost ([127.0.0.1]:34154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2xqg-0003fO-8N for submit@debbugs.gnu.org; Tue, 14 Nov 2023 13:09:18 -0500 Original-Received: from out-187.mta1.migadu.com ([2001:41d0:203:375::bb]:13537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2xqc-0003fE-UG for 67152@debbugs.gnu.org; Tue, 14 Nov 2023 13:09:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; s=key1; t=1699985310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sM4EYUyBwboXC5BEvwm5jRYFn0m1NWmY5hyw5TYPJVg=; b=Yj7P3qCJwFEwO7025VzFkoOYT0UTspKjN6SF8L5lMStKl1TYjbH84vhUDy2AxfW+Pi5Hrr z4lkDBVkChfy5yhZzg7MGy44NxTYJAVw+ZpU2lpw0XZGh8eyBScZCber0s8hqKC9EHvJjW v4MnUYoGBA1hlgY/y/vjqtx2iloD20Y= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. TLS-Required: No In-Reply-To: X-Migadu-Flow: FLOW_OUT 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:274326 Archived-At: November 14, 2023 at 2:26 PM, "Jo=C3=A3o T=C3=A1vora" wrote: > Oh no! Silly me, this isn't flymake.el at all!! I saw a fragment > of a loop and thought it was my code :-), i.e. a framework problem. Right. The problem is the code in lua-ts-mode. Here is the full recipe just in case (you need the tree-sitter-lua grammar and luacheck in PATH or set lua-ts-luacheck-program): src/emacs test.lua --init-directory=3D. M-x lua-ts-mode # test.lua print(1) print(2 # init.el (add-hook 'lua-ts-mode-hook #'flymake-mode) (add-to-list 'treesit-extra-load-path "~/.guix-profile/lib/tree-sitter"= ) (setopt lua-ts-luacheck-program "~/.luarocks/bin/luacheck") (toggle-debug-on-error) The error only shows up when the highlighted region is on the last line. > Well, then in this case, I think it should be OK, Thanks for confirming. > though users should test. What kind of test do you mean? > Backends are indeed expected to call flymake-diag-region to > get the region to highlight, as the manual and docstrings explain > (I think). I agree the docs are clear. I even used the example from the manual as a template. Now I can=E2=80=99t remember why I originally deviated from it on the region handling but I=E2=80=99m sure it was caused by a misunderstanding on my part.