GNU bug report logs -
#59617
29.0.50; Add indent styles to all tree-sitter modes
Previous Next
Reported by: Theodor Thornhill <theo <at> thornhill.no>
Date: Sat, 26 Nov 2022 19:00:02 UTC
Severity: normal
Found in version 29.0.50
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #61 received at 59617-done <at> debbugs.gnu.org (full text, mbox):
Theodor Thornhill <theo <at> thornhill.no> writes:
> On 30 November 2022 22:44:39 CET, Yuan Fu <casouri <at> gmail.com> wrote:
>>
>>Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>>>> From: Theodor Thornhill <theo <at> thornhill.no>
>>>> Cc: casouri <at> gmail.com, 59617 <at> debbugs.gnu.org
>>>> Date: Tue, 29 Nov 2022 16:19:26 +0100
>>>>
>>>> Theodor Thornhill <theo <at> thornhill.no> writes:
>>>>
>>>> > Rebased on emacs-29.
>>>> >
>>>>
>>>> Is this good to go or should I change something here?
>>>
>>> Good to go from my POV, but I wanted also to hear from Yuan.
>>>
>>> Thanks.
>>
>>Hey sorry, I was busy with some other things. I’ve looked at the patch,
>>it seems adding a hook that sets treesit-simple-indent-rules would have
>>the same effect, no? (Ie, user already can set a custom indent style)
>>Like instead of
>>
>>(defvar my-personal-csharp-mode-indent-rules (...))
>>
>>(setq csharp-ts-mode-indent-style
>> (lambda () my-personal-csharp-mode-indent-rules))
>>
>>you can just do
>>
>>(defvar my-personal-csharp-mode-indent-rules (...))
>>
>>(add-hook 'csharp-mode-hook
>> (lambda ()
>> (setq treesit-simple-indent-rules
>> my-personal-csharp-mode-indent-rules)))
>>
>>This way there is no need to define a custom option and a function for
>>each mode. And users can use the same variable
>>treesit-simple-indent-rules, just in different major mode hooks.
>>
>>Yuan
>
> Hmm I think you're right, and I think I agree :)
>
> Theo
Cool :-) I’m closing this then.
Yuan
This bug report was last modified 2 years and 209 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.