From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61142: 29.0.60; java-ts-mode - Wrong indentation for the body of multiple lines conditions Date: Sun, 05 Feb 2023 12:15:47 +0200 Message-ID: <83h6w0s9ik.fsf@gnu.org> References: <87wn4x7lpw.fsf_-_@thornhill.no> <87r0v47dky.fsf@thornhill.no> <83lelcsc2s.fsf@gnu.org> <87lelc796q.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16483"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61142@debbugs.gnu.org, zjyzhaojiyang@hotmail.com To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 05 11:16:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOc4L-00046U-10 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Feb 2023 11:16:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOc45-0005Zc-7M; Sun, 05 Feb 2023 05:16:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOc42-0005ZO-LX for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 05:16:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOc42-000739-4S for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 05:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pOc41-00042M-OW for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 05:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2023 10:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61142 X-GNU-PR-Package: emacs Original-Received: via spool by 61142-submit@debbugs.gnu.org id=B61142.167559214815492 (code B ref 61142); Sun, 05 Feb 2023 10:16:01 +0000 Original-Received: (at 61142) by debbugs.gnu.org; 5 Feb 2023 10:15:48 +0000 Original-Received: from localhost ([127.0.0.1]:44124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOc3o-00041n-4q for submit@debbugs.gnu.org; Sun, 05 Feb 2023 05:15:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOc3l-00041V-GN for 61142@debbugs.gnu.org; Sun, 05 Feb 2023 05:15:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOc3e-00072P-As; Sun, 05 Feb 2023 05:15:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x0v512K9L1fV37sR08T85BqhVZN3nF6F1njX5CL1gEk=; b=mWP9NU/zv8dZ 4xPmZ0OQkjf2/xHg9WT8qP2WAUhGqQSo859yuU2lXUh9/ulNYnMlIPKp7/Do6rB0fhU0Id4fmPKsg TjomOpHMwuYkDoGMH4C6QZVWQnRUa0blICouRHtMsm0hiAqck9uGTNsSLQIkpDeEnf1biHBx4g9XB y4CsOnH1wD7ycSSRN9gTZQ/3b0Ex5NT16l8Mj5QxC6fmGF6Q2c5BMNCEfTjxT2tIFZEDlEFOpDI9w 0BfXZsbpXw1B0LLCJnBaME7+gLnoMw88/GG2tfMV0qQvrDe7O0/6O4CEcaMaTdlZFtBonNWVMVrFJ IOGN3gacQ3oudxCq4lRg/A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOc3d-00059Q-Dt; Sun, 05 Feb 2023 05:15:38 -0500 In-Reply-To: <87lelc796q.fsf@thornhill.no> (message from Theodor Thornhill on Sun, 05 Feb 2023 10:28:29 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254837 Archived-At: > From: Theodor Thornhill > Cc: zjyzhaojiyang@hotmail.com, 61142@debbugs.gnu.org > Date: Sun, 05 Feb 2023 10:28:29 +0100 > > Eli Zaretskii 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?