GNU bug report logs - #76693
[PATCH] Use TS to support 'hs-minor-mode' in 'lua-ts-mode'

Previous Next

Package: emacs;

Reported by: jm <at> pub.pink

Date: Sun, 2 Mar 2025 21:39:02 UTC

Severity: normal

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 76693 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: john muhl <jm <at> pub.pink>
Cc: 76693 <at> debbugs.gnu.org
Subject: Re: bug#76693: [PATCH] Use TS to support 'hs-minor-mode' in
 'lua-ts-mode'
Date: Mon, 03 Mar 2025 19:33:50 +0200
>> This changes the hs-minor-mode suppport to use tree-sitter list
>> things instead of regexps.
>
> * lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Add list type to
> 'treesit-thing-settings'.

Coincidentally this is what I'm currently doing for all ts-modes
according to the principles agreed in bug#73404.

And it's nice to see that your changes are aligned with them.

There is no need to follow these principles since only you
as the author of the ts-mode decide what is suitable for this ts-mode.

But it would just make it easier for programmers in different languages
to switch between ts-modes that will meet their expectations.

I noticed only a few things that look like omission:

1. "arguments" and "parameters" are parenthesized expressions,
   but are missing in the 'list' setting;

2. "if_statement" without the anchors "\\`...\\'" (bos/eos in rx)
   matches "elseif_statement" too.  But unlike "if_statement",
   "elseif_statement" doesn't end with the "end" keyword
   (whereas "else_statement" doesn't end with "end" too
    but correctly excluded from matching);

3. Also would be nice to support '(forward-comment 1)'
   with something like (comment ,(rx bos "comment" eos))




This bug report was last modified 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.