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


View this message in rfc822 format

From: john muhl <jm <at> pub.pink>
To: 76693 <at> debbugs.gnu.org
Cc: Juri Linkov <juri <at> linkov.net>
Subject: bug#76693: [PATCH] Use TS to support 'hs-minor-mode' in 'lua-ts-mode'
Date: Fri, 07 Mar 2025 08:29:55 -0600
[Message part 1 (text/plain, inline)]
Updated patch with Juri’s feedback.

[0001-Use-TS-to-support-hs-minor-mode-in-lua-ts-mode.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

john muhl <jm <at> pub.pink> writes:

> Juri Linkov <juri <at> linkov.net> writes:
>
>>>> 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.
>
> That’s good to hear.
>
>> 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))
>
> Sounds good. I was aiming for parity with lua-mode but no reason
> to stop there. I’ll get an updated patch over soon.
>
> Thanks for the help.


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.