Subject: Re: bug#61142: 29.0.60; java-ts-mode - Wrong indentation for the body of multiple lines conditions

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Feb 2023 12:15:47 +0200

> From: Theodor Thornhill <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Sun, 05 Feb 2023 10:28:29 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >
> > The procedure is "git cherry-pick", but I don't think I understand
> > what exactly is the problem here and what is the solution suggested to
> > solve it.  Also, why does it need to be on emacs-29.  Can you help me
> > understand that?
> >
> 
> No need to have the test files on emacs-29.  I could just as well add a
> test when emacs-29 is synced to master later.  The test-files themselves
> don't exist on emacs-29.

OK, but still: what exactly is the problem that your patch is trying
to fix?  I didn't understand that from the original report.

And one comment to the patch:

> @@ -300,6 +302,20 @@ java-ts-mode
>    (c-ts-common-comment-setup)
>  
>    ;; Indent.
> +  (setq-local c-ts-common-indent-block-type-regexp
> +              (rx (or "class_body"
> +                      "\\`array_initializer"
> +                      "annotation_type_body"
> +                      "interface_body"
> +                      "interface_constructor_body"
> +                      "enum_body"
> +                      "switch_block"
> +                      "record_declaration_body"
> +                      "block")))
> +  (setq-local c-ts-common-indent-bracketless-type-regexp
> +              (rx (or "if_statement" "do_statement"
> +                      "for_statement" "while_statement")))
> +  (setq-local c-ts-common-indent-offset 'java-ts-mode-indent-offset)
>    (setq-local treesit-simple-indent-rules java-ts-mode--indent-rules)
>  
>    ;; Electric

Why are we adding a c-ts-common-SOMETHING variable to java-ts-mode.el?
Shouldn't it be named java-ts-SOMETHING instead?  Or am I missing
something?