From unknown Fri Jun 20 07:11:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#75650 <75650@debbugs.gnu.org> To: bug#75650 <75650@debbugs.gnu.org> Subject: Status: 30.0.93; Unexpected indentation of members of inner classes in java-ts-mode Reply-To: bug#75650 <75650@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:11:32 +0000 retitle 75650 30.0.93; Unexpected indentation of members of inner classes i= n java-ts-mode reassign 75650 emacs submitter 75650 Hennes M=C3=A4rtins severity 75650 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 18 12:03:56 2025 Received: (at submit) by debbugs.gnu.org; 18 Jan 2025 17:03:56 +0000 Received: from localhost ([127.0.0.1]:43565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tZCEk-0001nF-2E for submit@debbugs.gnu.org; Sat, 18 Jan 2025 12:03:56 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55286) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tZB4e-0006o8-M0 for submit@debbugs.gnu.org; Sat, 18 Jan 2025 10:49:25 -0500 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 1tZB4X-0004Im-J3 for bug-gnu-emacs@gnu.org; Sat, 18 Jan 2025 10:49:17 -0500 Received: from relay.yourmailgateway.de ([188.68.63.162]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tZB4N-000139-0u for bug-gnu-emacs@gnu.org; Sat, 18 Jan 2025 10:49:17 -0500 Received: from mors-relay-8201.netcup.net (localhost [127.0.0.1]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4Yb1HJ0PHsz3wWm for ; Sat, 18 Jan 2025 16:49:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=maertins-zone.de; s=key2; t=1737215340; bh=zsZ4zSbEwO6pT65Eid2S/7dj8h+ok2GKyEtKHhjiPcQ=; h=From:To:Subject:Date:From; b=cRaLihvMyfXiBzJMb7ihXVr/uNeWYCt4CM8JuuEk8+zELfuEnq5lLE6lXgpQYhXxD e0fri656OtwjdZ2puvLkpkFcECBDyFCB7R5WCegj43PUmeIseOn4ISWVFcGLFmGW2S siE39tJb1yYsWr36Gzbrrc76xHsWUmEqXQI67ptAXH0b5wqmbfmFCt9FpaOAORj4VC KwGaCRvSnqumJOXRsacvFCKMxVqR4t/Znei35VQhhPNaq0G91smCLysFRmhKX5qZ8M uvJVFdaUVgIISCNvS1fKJn4CrvKquivrmULxx294L5nBRLDUhYCluHOdoM8rFXQruB YlqlZ3+zrnPog== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4Yb1HH6nNtz3wVv for ; Sat, 18 Jan 2025 16:48:59 +0100 (CET) Received: from mxe8e7.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4Yb1HH52Q3z8scM for ; Sat, 18 Jan 2025 16:48:59 +0100 (CET) Received: from starlight (host-091-097-159-133.ewe-ip-backbone.de [91.97.159.133]) by mxe8e7.netcup.net (Postfix) with ESMTPSA id 1400760572 for ; Sat, 18 Jan 2025 16:48:55 +0100 (CET) Authentication-Results: mxe8e7; spf=pass (sender IP is 91.97.159.133) smtp.mailfrom=hennes@maertins-zone.de smtp.helo=starlight Received-SPF: pass (mxe8e7: connection is authenticated) From: =?utf-8?Q?Hennes_M=C3=A4rtins?= To: bug-gnu-emacs@gnu.org Subject: 30.0.93; Unexpected indentation of members of inner classes in java-ts-mode X-Debbugs-Cc: Date: Sat, 18 Jan 2025 16:48:41 +0100 Message-ID: <86ikqcp1gm.fsf@maertins-zone.de> MIME-Version: 1.0 Content-Type: text/plain X-PPP-Message-ID: <173721533526.50849.14971674869846870325@mxe8e7.netcup.net> X-Rspamd-Queue-Id: 1400760572 X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: cLFfEZKct2ZhwQXrw8R37jnHrwDVULTDYisdqHc0I7K2+8RmS8k9 Received-SPF: pass client-ip=188.68.63.162; envelope-from=hennes@maertins-zone.de; helo=relay.yourmailgateway.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 18 Jan 2025 12:03:50 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Create a new java-ts-mode buffer with the following content: class Foo { class Bar { int baz; } } Indent the whole buffer (C-x h ) and it becomes: class Foo { class Bar { int baz; } } The indentation level for baz becomes three, but I would expect it to be two. A level of two is used in java-mode too. If I put the opening curly brace to the end of the previous line, the indentation level becomes two as expected: class Foo { class Bar { int baz; } } I found a personal workaround for this by modifying the variable java-ts-mode--indent-rules. I replace the entry: ((parent-is "class_body") column-0 c-ts-common-statement-offset) with: ((parent-is "class_body") parent-bol java-ts-mode-indent-offset) That works for me, but I am not sure if that is the correct solution. I can reproduce this also in: GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2025-01-18 In GNU Emacs 30.0.93 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0) of 2024-12-27 built on starlight Repository revision: 186ea407326166ee4669ce6fe84871c1e16c657c Repository branch: emacs-30 Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Ubuntu 22.04.5 LTS Configured using: 'configure --with-x-toolkit=lucid --without-toolkit-scroll-bars --with-mailutils --with-json --with-tree-sitter --with-native-compilation --with-imagemagick' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK JPEG LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: de_DE.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 49847 24349) (symbols 48 5370 0) (strings 32 14514 1668) (string-bytes 1 391591) (vectors 16 8999) (vector-slots 8 126175 11702) (floats 8 24 3) (intervals 56 288 0) (buffers 992 10)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 18 18:32:53 2025 Received: (at 75650) by debbugs.gnu.org; 18 Jan 2025 23:32:53 +0000 Received: from localhost ([127.0.0.1]:44135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tZIJA-0006vI-RG for submit@debbugs.gnu.org; Sat, 18 Jan 2025 18:32:53 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:61852) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tZIJ6-0006uw-2Q for 75650@debbugs.gnu.org; Sat, 18 Jan 2025 18:32:50 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d3d0205bd5so5098472a12.3 for <75650@debbugs.gnu.org>; Sat, 18 Jan 2025 15:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737243162; x=1737847962; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=Shuurnq5CWmEffFOje8WxiUWmzWGQLde8oX+koDNkcM=; b=UJvSRUxfW5zenzY64XUASLqDNNmJIef1PcZO/Klu+uu00zGEUHs0sQ/F2pbe1ptCad uN4J7/4nuN/wb/LRk65BvdYVaodO0JFzCi9WFofHI3u5WUEmDYmzoBwT4VIrau2WTMTk 3Pbc4074EApmRidIqulPDEsrthBE38Jz0sVHI2QHtefHX+zcXFhc6akjC9qtBIXzmkl4 GMIWG9SL7318VPjnk5TUEsOlpoRUwpD0QeawFpgBjKBIAHg+kzJWRbL2YiyPl28AkSP8 JQ1kyldajGLP3KWj3Iz1433BLKtY8SbuxmTpQsMQwyq6eAKdvHEuJNAkpr/jfwPeQ+XV 531Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737243162; x=1737847962; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Shuurnq5CWmEffFOje8WxiUWmzWGQLde8oX+koDNkcM=; b=If9q/0eviOe+fVge8lfnwk/cR5b9uissVF+SZE/2JkewtFc/7FNbZiFaY6teSLtwMk vkk3s93Da9NFAh8mc3PMSsBMTv3OL2kpXmQCfd5DXy/4sNXa/lNLoz8hB7sQVBCUIRkn yEmXMRAU6HqmPeaDAc08JEehEDRGS/pf3Fc9fgoIShR0uskK7jIpINCVaqbIEHxI7I2E xCQ2hsPLv5zD0Hs3ZfQSwY8RUEo6CO5I5T0R82nu9Ry4Cz0UPy6TfJOPhPUA15cFVOJ+ ZU8BmR64eBmS6Q1SV+min+jsb/XbHa0AhFKk0+2pOmT9P81GpqvogbnI8ytfklSJizNc 2p1w== X-Forwarded-Encrypted: i=1; AJvYcCU8POuvRIdV/yJw9kaT4G1BAmLroA7MugL2LA1Egx+2nZsjZvKx1RcNuVfj39cixyLGi1o4+Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywm5YNjN6xBdGDLBH2HDwsgPCZleE1cea0OqjgCrRgwMn5rJQjs eDSyKxNGhb6iSlfuJvmdidM4hBbgAeyMoMoKErePNwt3XJo9hbL5+DYeo/1glB9lTlGaBiZyWHG Kv6PG1fV/6a/EkqyaCvy4B+u4ebg= X-Gm-Gg: ASbGncvIbDCHG8M/hqB/KRJ6FxLtN8/1UyKNoJf9PYcsOgdy8vO4SL90Lx1hxCbtcAq t61cTnUvNILrD62n8rRXTiYxep8IxNRQOha9j8zNX4HgTF9Q50gqO X-Google-Smtp-Source: AGHT+IEGHn2uNULltDWR580eOJwcEnBYbJd+ksrT4FHJztiK3HVKd1cJ8p2O2Gc4KmXeAYIyqEh9viq97T7kJIee1no= X-Received: by 2002:a05:6402:270d:b0:5cf:e9d6:cc8a with SMTP id 4fb4d7f45d1cf-5db7db148e2mr5654928a12.20.1737243161832; Sat, 18 Jan 2025 15:32:41 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 18 Jan 2025 15:32:41 -0800 From: Stefan Kangas In-Reply-To: <86ikqcp1gm.fsf@maertins-zone.de> References: <86ikqcp1gm.fsf@maertins-zone.de> MIME-Version: 1.0 Date: Sat, 18 Jan 2025 15:32:41 -0800 X-Gm-Features: AbW1kvYOGZIZ92GiWdqKWPmyAqQtXE7aqz5fYePYQF1iBcPru80eev_YTaUmTx8 Message-ID: Subject: Re: bug#75650: 30.0.93; Unexpected indentation of members of inner classes in java-ts-mode To: =?UTF-8?Q?Hennes_M=C3=A4rtins?= , 75650@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75650 Cc: Theodor Thornhill X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hennes M=C3=A4rtins writes: > Create a new java-ts-mode buffer with the following content: > > class Foo > { > class Bar > { > int baz; > } > } > > Indent the whole buffer (C-x h ) and it becomes: > > class Foo > { > class Bar > { > int baz; > } > } > > The indentation level for baz becomes three, but I would expect it to be > two. A level of two is used in java-mode too. > > If I put the opening curly brace to the end of the previous line, the > indentation level becomes two as expected: > > class Foo { > class Bar { > int baz; > } > } > > I found a personal workaround for this by modifying the variable > java-ts-mode--indent-rules. I replace the entry: > > ((parent-is "class_body") column-0 c-ts-common-statement-offset) > > with: > > ((parent-is "class_body") parent-bol java-ts-mode-indent-offset) > > That works for me, but I am not sure if that is the correct solution. > > I can reproduce this also in: > GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, ca= iro version 1.16.0) of 2025-01-18 Theodor, any comments here? > In GNU Emacs 30.0.93 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo > version 1.16.0) of 2024-12-27 built on starlight > Repository revision: 186ea407326166ee4669ce6fe84871c1e16c657c > Repository branch: emacs-30 > Windowing system distributor 'The X.Org Foundation', version 11.0.1210100= 4 > System Description: Ubuntu 22.04.5 LTS From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 20 21:26:09 2025 Received: (at control) by debbugs.gnu.org; 21 Jan 2025 02:26:09 +0000 Received: from localhost ([127.0.0.1]:52610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ta3xx-0004Po-Bl for submit@debbugs.gnu.org; Mon, 20 Jan 2025 21:26:09 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:53500) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ta3xv-0004PF-A6 for control@debbugs.gnu.org; Mon, 20 Jan 2025 21:26:08 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-ab643063598so35645466b.2 for ; Mon, 20 Jan 2025 18:26:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737426361; x=1738031161; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=aIS71waPZq9sooihKY3oP+NnrdK6X45LX8wTnxT/aEA=; b=a4O3wtUTogc2XCwqdEHaSRtHwfJ4oBgzYwtiWuT2KXJf2z06CNldzS/2D4UaXVRtmS Gy0Gtg7bf5LjbpEN12JLVotVTE77ADQfbxeR/E/PvXK6SY/SaLkf3i0mYt2PzxXP2z7l LycJJ9v5hShxFVb/Yke/k5sW+k93D9Lsgcc+LTc/l+xHevZKKgmBuZ7JMpPSWND3ULAq jC6oGvZOcfGZwAi22mJo1EqyfWiwLE7SaUX+EXPqIgNbCiG8l2+8OLzEqPlxi0eMrh9s YryH0VbRtNWE50PBLmfs1is0LqCbpn02mFtDZKX+siGsszG47ZNTPtFIwv53Ws5U8L11 DC3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737426361; x=1738031161; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aIS71waPZq9sooihKY3oP+NnrdK6X45LX8wTnxT/aEA=; b=MuLf3rxhkvzRa4AfSPDAxGjAsCndpa5QyQuAivqadKlEYvYRLONodmb2QFOw46nFzU zK+/k9x9gJTcKVSWWiJegbWjt3flG2gSgiD8mt5VwkgMlR7shL3hyPtN2RSWO2/6h6z/ J0gQHI0KLGO9Q94NVUwQsdycvQrHFUzK1ryDsxcdju73m/+3NDmdZQBZfbm64MMrhhnW ksIsdNUqS2SILXxk/AvImS7043DwMTc8FpdMrL59z6dXEznDBwsCbJM2SxJU2LqoB40o BxjQ9/VGjuHdJR+PJyHIahqRlr79kVvVyvKnyHO7TSEP1gA1kuKdHyQAT1OAcovodimx KvQg== X-Gm-Message-State: AOJu0Yx7a3x0PrQgbg6pJJy/J898zl6ZcL2k3swIJ4iit75/81CWfP3/ r4fTTASiGKnUFCNj2hjfqpXW8DAxwL2/OmMrbOlNpFgXMZU52s/d1JZMvmwA6qEZJiThrcO/NJZ FOctPWBUP06cO/8uhzaEbcE5AiK80WVfn X-Gm-Gg: ASbGnctuk4FcG8qRQa5raj9+tLt+sjB/rOEzIa5VrxInq7Kg4HwcYuNi+j8WYvEZLFd xVib8eA94IXNKA9D2mUvDxDoyTKdYxbahtUnvce9t0dCU7Z6XJcUn8A== X-Google-Smtp-Source: AGHT+IFitSCEmERzh6fXQipiNWd2HWtd8vwj6u5qb7AvwaPWbo49YuD+kxW4M8aOYZhE3+qfweek6WQ8JYzymuCdRfY= X-Received: by 2002:a05:6402:4416:b0:5d0:d3eb:a78f with SMTP id 4fb4d7f45d1cf-5db7d0eca61mr39234596a12.0.1737426361066; Mon, 20 Jan 2025 18:26:01 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 20 Jan 2025 20:26:00 -0600 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 20 Jan 2025 20:26:00 -0600 X-Gm-Features: AbW1kva4LGYp6nV9QeKmBfAczqKRlc99vOrYdP6lExVVyo0OZCZqtGmeyJYH0IY Message-ID: Subject: control message for bug #75650 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 75650 minor quit From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 19 15:01:34 2025 Received: (at 75650) by debbugs.gnu.org; 19 Feb 2025 20:01:34 +0000 Received: from localhost ([127.0.0.1]:52377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tkqGD-0001hI-QU for submit@debbugs.gnu.org; Wed, 19 Feb 2025 15:01:34 -0500 Received: from relay.yourmailgateway.de ([188.68.61.103]:48135) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tkqGA-0001Z4-Ep for 75650@debbugs.gnu.org; Wed, 19 Feb 2025 15:01:32 -0500 Received: from mors-relay-8403.netcup.net (localhost [127.0.0.1]) by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4YynMr2mpsz86dJ for <75650@debbugs.gnu.org>; Wed, 19 Feb 2025 21:01:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=maertins-zone.de; s=key2; t=1739995288; bh=kgaqQjLbsiCjvd2FKAKvsRDe/YAyPSkKX6EltdGIWZs=; h=Date:From:To:Subject:From; b=DNdEjjOQQGfti4DgurnpqdJSEFG8RRHRWyx5H6agw3/EZD07Ve0YuETyP34bfC/0F 1mo+r2LEQ0OD87RqK0EdTuSNEnsvF0E56x0N4mAVgxIcuGiC017Xx0igQ7hNwxPdSu mSS9tr3BhQ3nK61DzV+pdAYda26OcsVL9kx0qVcNfQtu2UR5A6KK0khipEct7M9A61 potWiuVQPKHceTnkTzVW40TPAZJhmEAHuOj/RCv6PitT/O/yhsgUngCZCEi+8x1xpn EkNbqWzawQhmc64wvaSydLxY9UE0cg3K59XzC11izDjVWWqcT99cSU+VRYlATp/frY 1Ir57DHIjIYJQ== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4YynMr2NN8z86dD for <75650@debbugs.gnu.org>; Wed, 19 Feb 2025 21:01:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.901 X-Spam-Level: X-Spam-Status: No, score=-2.901 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from mxe8e7.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4YynMq5Wk1z8t2h for <75650@debbugs.gnu.org>; Wed, 19 Feb 2025 21:01:27 +0100 (CET) Received: from starlight (host-091-097-155-075.ewe-ip-backbone.de [91.97.155.75]) by mxe8e7.netcup.net (Postfix) with ESMTPSA id 2F7116100B for <75650@debbugs.gnu.org>; Wed, 19 Feb 2025 21:01:23 +0100 (CET) Authentication-Results: mxe8e7; spf=pass (sender IP is 91.97.155.75) smtp.mailfrom=hennes@maertins-zone.de smtp.helo=starlight Received-SPF: pass (mxe8e7: connection is authenticated) Date: Wed, 19 Feb 2025 21:00:53 +0100 Message-Id: <865xl5g0wa.fsf@maertins-zone.de> From: =?utf-8?Q?Hennes_M=C3=A4rtins?= To: 75650@debbugs.gnu.org Subject: bug#75650: Acknowledgement (30.0.93; Unexpected indentation of members of inner classes in java-ts-mode) MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <173999528335.721406.4743323460559795146@mxe8e7.netcup.net> X-Rspamd-Queue-Id: 2F7116100B X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: 1sgxaTXeZQLEZsZw92O+SgsGLqeBY82QiyXvOTjB1etz+KlunI46 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75650 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I figured out that this behavior is not limited to inner classes. I see the same behavior when I replace "class Bar" with "interface Bar" or "enum Bar" in the example which I gave you in my report. I adjusted my personal workaround accordingly and replaced ((parent-is "interface_body") column-0 c-ts-common-statement-offset) with ((parent-is "interface_body") parent-bol java-ts-mode-indent-offset) and ((parent-is "enum_body") column-0 c-ts-common-statement-offset) with ((parent-is "enum_body") parent-bol java-ts-mode-indent-offset) From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 19 16:20:04 2025 Received: (at 75650) by debbugs.gnu.org; 19 Feb 2025 21:20:05 +0000 Received: from localhost ([127.0.0.1]:53210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tkrUC-0005hj-5O for submit@debbugs.gnu.org; Wed, 19 Feb 2025 16:20:04 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:47561) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tkrU5-0005gJ-Rb for 75650@debbugs.gnu.org; Wed, 19 Feb 2025 16:20:01 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5e0939c6456so306898a12.3 for <75650@debbugs.gnu.org>; Wed, 19 Feb 2025 13:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739999991; x=1740604791; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=+ns4Hn8YJOKdgFh+DYB41dzJf6+ujBoYeHgGozkTf+M=; b=kgfcZHYQSOsrBP6uTdQSpMaDNLv4inPgpJihum3L9u4AfAxVN52i/Hbpb7u8cJ0QmR d8Ig5et7Eehdn6CJw0Q4pIPmMkkUwP654YIynq19PJwJ+ZxgVlKl89kUPK7nrpvq4/qc YJbbLkZRIWz5m4HpGcTsnIAOTetuqNPtTK/KyxIskY55cqbNKTMDDdpw10SZEHDyEa5V /7CbGy9j2khP7jCWUyB82Y8Hs7X/5qspWDhu6hith4MpXYc1a9HhhbhGQ2wir5w2nUOi DQtFncG8qKenErwBvkYjT8wmz4I5jYNrasSxmeckk6+t8aMpPBdnI5Wgqr3/UIoU2QhH Y3Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739999991; x=1740604791; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+ns4Hn8YJOKdgFh+DYB41dzJf6+ujBoYeHgGozkTf+M=; b=BUhU2c5+uFmwW60pWGibEOzFg8ld3BcNEFAEovdwDctcHzbi1sYT2gkE4unbhit1VU vjBM2EVGIm+W6y4G+iNP31rmsy70c9GtiQWJ2MknnRtbFe99EBb1l1ET2wqH5JlFAARl BLhg8oKz3ECTeMuEBcP3a2YpkqfxGO4wxQ7nU8wTxkvg8AALatAvJ8qzAzeB9YRM/bbU bfZ8U49Iwd5vj8x3n8ujglCJyI6FRK0xEcQWcVRebqcX7Y9zELVYIaWXrseLq4CnP6T5 wJLeI2d2v1Wd5f8d0EMO/E98y8NX2AHuaRYmzxctW5N5rJoKWfojw6MhTwuFiSfSqk2m 3Aew== X-Forwarded-Encrypted: i=1; AJvYcCXNGhcn1Qag0iYacocEot++/lpxfppfB2Fm+bbByq370YpCP7pUNUHMXEG4VaBtKx8Sc6fThg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwxeBiYiTKcAoO1zyM2Tnu9S860Zt0Hpeebr32s/aQ1gQl8Ioo3 ya4kHXB6WgFRFmNBEvCJXTqyw7FYt3Crx7sEFcX1JUEByTNUFptCzwVpPdCPGK7a4AnDH+ZI31n N3YacxIfNkObmJVcr4pZN+aoh5Lc= X-Gm-Gg: ASbGncsNGsqtXRGK23ew4p5dv4xJCyDDq1No/R0YaKO7n//n4+Kfy0fomdFOvTwz1ZT U7o/3KJeBNzVwZCe5EB+TXLsukmsH6XAic0yHN8vdYNe8+p3XYf63GRFv/0GgN953FHqmT5PpDQ == X-Google-Smtp-Source: AGHT+IHxSNomdQhp2KQ/zwgxMFvfTN/FE6SMjc9LXOsj6g7ZdqAmb+OK5h2l/kc40h3hFvpF/aB6rMpDmzUKaOun7CI= X-Received: by 2002:a05:6402:27d3:b0:5e0:3584:28d2 with SMTP id 4fb4d7f45d1cf-5e03601e83fmr17487724a12.2.1739999991256; Wed, 19 Feb 2025 13:19:51 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 19 Feb 2025 13:19:50 -0800 From: Stefan Kangas In-Reply-To: References: <86ikqcp1gm.fsf@maertins-zone.de> MIME-Version: 1.0 Date: Wed, 19 Feb 2025 13:19:50 -0800 X-Gm-Features: AWEUYZmDoIxfWLKRdPjSDPCzh-kjMY7RTRzuPQaugk1PadMRf-WdWbqGtD7ucbA Message-ID: Subject: Re: bug#75650: 30.0.93; Unexpected indentation of members of inner classes in java-ts-mode To: =?UTF-8?Q?Hennes_M=C3=A4rtins?= , 75650@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75650 Cc: Theodor Thornhill X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Hennes M=C3=A4rtins writes: > >> Create a new java-ts-mode buffer with the following content: >> >> class Foo >> { >> class Bar >> { >> int baz; >> } >> } >> >> Indent the whole buffer (C-x h ) and it becomes: >> >> class Foo >> { >> class Bar >> { >> int baz; >> } >> } >> >> The indentation level for baz becomes three, but I would expect it to be >> two. A level of two is used in java-mode too. >> >> If I put the opening curly brace to the end of the previous line, the >> indentation level becomes two as expected: >> >> class Foo { >> class Bar { >> int baz; >> } >> } >> >> I found a personal workaround for this by modifying the variable >> java-ts-mode--indent-rules. I replace the entry: >> >> ((parent-is "class_body") column-0 c-ts-common-statement-offset) >> >> with: >> >> ((parent-is "class_body") parent-bol java-ts-mode-indent-offset) >> >> That works for me, but I am not sure if that is the correct solution. >> >> I can reproduce this also in: >> GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, c= airo version 1.16.0) of 2025-01-18 > > Theodor, any comments here? Friendly ping. >> In GNU Emacs 30.0.93 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo >> version 1.16.0) of 2024-12-27 built on starlight >> Repository revision: 186ea407326166ee4669ce6fe84871c1e16c657c >> Repository branch: emacs-30 >> Windowing system distributor 'The X.Org Foundation', version 11.0.121010= 04 >> System Description: Ubuntu 22.04.5 LTS