unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: jm--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "João Távora" <joaotavora@gmail.com>, "Eli Zaretskii" <eliz@gnu.org>
Cc: 67152@debbugs.gnu.org
Subject: bug#67152: [PATCH] Fix flymake integration in lua-ts-mode
Date: Tue, 14 Nov 2023 18:08:28 +0000	[thread overview]
Message-ID: <1ed27e2fe45fc117376415bb1a2dbffcb8f69903@pub.pink> (raw)
In-Reply-To: <CALDnm50=108LEWC5mxihzVvBGvU3T8uYjf2q+OAbtgxsf3tO-g@mail.gmail.com>

November 14, 2023 at 2:26 PM, "João Távora" <joaotavora@gmail.com> 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=.
  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’t remember why I originally
deviated from it on the region handling but I’m sure it was
caused by a misunderstanding on my part.





  parent reply	other threads:[~2023-11-14 18:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <handler.67152.B.169991476321361.ack@debbugs.gnu.org>
2023-11-13 22:31 ` bug#67152: [PATCH] Fix flymake integration in lua-ts-mode jm--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-13 22:40   ` jm--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-14 14:13     ` Eli Zaretskii
2023-11-14 14:23       ` João Távora
2023-11-14 14:26         ` João Távora
2023-11-14 14:37         ` Eli Zaretskii
2023-11-14 18:08         ` jm--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-11-15  0:09         ` jm--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 12:24           ` João Távora
2023-11-15 13:02           ` Eli Zaretskii

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=1ed27e2fe45fc117376415bb1a2dbffcb8f69903@pub.pink \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67152@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jm@pub.pink \
    --cc=joaotavora@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).