From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Apr 2025 14:26:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 77901@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17449863317169 (code B ref -1); Fri, 18 Apr 2025 14:26:06 +0000 Received: (at submit) by debbugs.gnu.org; 18 Apr 2025 14:25:31 +0000 Received: from localhost ([127.0.0.1]:52400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5mei-0001pt-MM for submit@debbugs.gnu.org; Fri, 18 Apr 2025 10:25:28 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53554) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5meZ-0001mT-MP for submit@debbugs.gnu.org; Fri, 18 Apr 2025 10:25:21 -0400 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 1u5meT-0007Dm-RX for bug-gnu-emacs@gnu.org; Fri, 18 Apr 2025 10:25:09 -0400 Received: from forward200a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u5me5-0007l7-3a for bug-gnu-emacs@gnu.org; Fri, 18 Apr 2025 10:25:09 -0400 Received: from forward100a.mail.yandex.net (forward100a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d100]) by forward200a.mail.yandex.net (Yandex) with ESMTPS id 4DD3465BA3 for ; Fri, 18 Apr 2025 17:07:36 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0d:4d14:0:640:55f0:0]) by forward100a.mail.yandex.net (Yandex) with ESMTPS id CA3BA46EFD for ; Fri, 18 Apr 2025 17:06:35 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Y6LANB1LkCg0-bWjMD4Ro; Fri, 18 Apr 2025 17:06:35 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1744985195; bh=C6D3epvRnl3uRumKT0+588A6/2TWzRQVZ8muwR6MKrQ=; h=Date:To:From:Subject:Message-ID; b=fYq5Qg4oY1AyaUoEZaAFmmXZm68D2V2g9DqY4B8RaOYQj8x8bgyTwQ4IrzqcqqbqH CR43qfR+NLr6gs1vAbYH0mR/HD/tuWFPneMCTk77dtaHZ2oPmmlc8YkAmHRd1NPUEa 6wilc8foFEIBaufZPfWBM8XHjrBByCjD8luNZtMQ= Authentication-Results: mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> From: Konstantin Kharlamov Date: Fri, 18 Apr 2025 17:06:34 +0300 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a02:6b8:c0e:500:1:45:d181:d200; envelope-from=hi-angel@yandex.ru; helo=forward200a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) 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 (/) Given this correctly indented code: const a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : 4; if you reindent it, it turns into: const a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : 4; Basically, for every colon it increases indentation. This is different from other c-like languages (it's is indented as the first form instead), and it's also different from Python. The "tree-indentation" is not readable, so there's a reason other modes indent it as the first example. Would it be possible to change in typescript mode as well? From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> In-Reply-To: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 May 2025 13:40:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 77901@debbugs.gnu.org Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.17461067604089 (code B ref 77901); Thu, 01 May 2025 13:40:06 +0000 Received: (at 77901) by debbugs.gnu.org; 1 May 2025 13:39:20 +0000 Received: from localhost ([127.0.0.1]:49806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uAU8F-00013r-J1 for submit@debbugs.gnu.org; Thu, 01 May 2025 09:39:20 -0400 Received: from forward100b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d100]:60608) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uAU8B-00013U-Sp for 77901@debbugs.gnu.org; Thu, 01 May 2025 09:39:17 -0400 Received: from mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net [IPv6:2a02:6b8:c11:797:0:640:5446:0]) by forward100b.mail.yandex.net (Yandex) with ESMTPS id A468460B29 for <77901@debbugs.gnu.org>; Thu, 1 May 2025 16:39:07 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 3dXQlUdLhiE0-p3DPECDD; Thu, 01 May 2025 16:39:06 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1746106747; bh=+IS8wT5xG+HiV+bud3HyXPgTDngz2zyRiouRvNAvjxA=; h=Date:To:From:Subject:Message-ID; b=jl9sL3ntgQXPNv7EvCARhGy0sQu46wUuom5vZTfElJR/CqQzVQ50D0XqUcKdrhD68 LSK4Tz72H3wKCJ059/b+AYFjCMwo/wT4Xp/1ILcVGQben72rF7jEwFe9vG0/7W0XSO 7haEjy2Kg5EC6gUkR8+V2e5ho3YM8jfsAgv8wilc= Authentication-Results: mail-nwsmtp-smtp-production-main-57.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: From: Konstantin Kharlamov Date: Thu, 01 May 2025 20:39:02 +0700 Content-Type: multipart/mixed; boundary="=-b+uWvRq0/SkDmMRO7Dez" User-Agent: Evolution 3.56.1 MIME-Version: 1.0 X-Spam-Score: -0.7 (/) 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.7 (-) --=-b+uWvRq0/SkDmMRO7Dez Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable After poking around I wrote a patch (attached). Worth noting though, for some reason it doesn't work for ternary without starting colon, e.g.: const a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : 4; I'm unclear why, per my understanding the "standalone-parent" of the whole ternary chain (disregarding where the point is) is the `const a =3D` declaration. Such bug also persists in c++-ts-mode (as opposed to non-ts plain c++- mode). I'm not sure if it's me misunderstanding something or not=E2=80=A6 --=-b+uWvRq0/SkDmMRO7Dez Content-Disposition: attachment; filename="1.patch" Content-Type: text/x-patch; name="1.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJvbSAwYWZmMWNmNTllZmY4Zjk0YzcyYmMwYzM4M2Q2MDg5MTg1MzU3ZTY2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLb25zdGFudGluIEtoYXJsYW1vdiA8SGktQW5nZWxAeWFuZGV4 LnJ1PgpEYXRlOiBUaHUsIDEgTWF5IDIwMjUgMjA6Mjg6MjkgKzA3MDAKU3ViamVjdDogW1BBVENI XSB0eXBlc2NyaXB0LXRzOiBhbGlnbiB0ZXJuYXJ5LWNoYWluIGJyYW5jaGVzIChidWcjNzgxODcp CgpsaXNwL3Byb2dtb2Rlcy90eXBlc2NyaXB0LXRzLW1vZGUuZWwgKHR5cGVzY3JpcHQtdHMtbW9k ZS0taW5kZW50LXJ1bGVzKToKbWFrZSBzdXJlIGVhY2ggbmV3IHRlcm5hcnkgYnJhbmNoIGlzIGFs aWduZWQgd2l0aCB0aGUgcHJldmlvdXMgb25lLgp0ZXN0L2xpc3AvcHJvZ21vZGVzL3R5cGVzY3Jp cHQtdHMtbW9kZS1yZXNvdXJjZXMvaW5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LXRzLW1vZGUtaW5kZW50 LW9mZnNldCAyKQotLSAKMi40OS4wCgo= --=-b+uWvRq0/SkDmMRO7Dez-- From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 May 2025 10:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Konstantin Kharlamov , Yuan Fu Cc: 77901@debbugs.gnu.org Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174687220210242 (code B ref 77901); Sat, 10 May 2025 10:17:01 +0000 Received: (at 77901) by debbugs.gnu.org; 10 May 2025 10:16:42 +0000 Received: from localhost ([127.0.0.1]:44243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDhG5-0002f7-OE for submit@debbugs.gnu.org; Sat, 10 May 2025 06:16:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41616) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDhG2-0002eu-RW for 77901@debbugs.gnu.org; Sat, 10 May 2025 06:16:39 -0400 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 1uDhFx-0005wQ-97; Sat, 10 May 2025 06:16:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=NRpVcBh8+Sd+FxQ8tPyRHNOo9PiJmML52OFXaFfUCPo=; b=YFqhwp0ohcp4OqwIVouk geE4RUWKW0JNPiiDteaDBg+sL41konIjYMYtfOHgyLVjdT6TJAZIpZD4WXlAzq0Iqa6B63ICd5xHe z7BW6fVcNQedGrmKUx3f6D3zfiNY5WqviU2MBMYdDq8FAn4z3PIOYTbIrP+NEc0A6PkGI3GedipwG Z/PggZ/aeNck4YTSGK8emXWs1KD9xi4Px2KnG89LP+f07VjIqUEYuzylbGFH1fk9jmvrD54HH2g1U bPyy9daJheFNeQg3+Q0R2kSPRUfmFFdqKsIAfr+gHpY44pvAe0gQCaOMJS/PHKyqK0bCMo5/p9J5K /ibTSP1ncsPMKw==; Date: Sat, 10 May 2025 13:16:30 +0300 Message-Id: <86ikm8ahz5.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Konstantin Kharlamov on Thu, 01 May 2025 20:39:02 +0700) References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Konstantin Kharlamov > Date: Thu, 01 May 2025 20:39:02 +0700 > > After poking around I wrote a patch (attached). Worth noting though, for > some reason it doesn't work for ternary without starting colon, e.g.: > > const a = cond1 ? 1 : > cond2 ? 2 : > cond3 ? 3 : 4; > > I'm unclear why, per my understanding the "standalone-parent" of the > whole ternary chain (disregarding where the point is) is the `const a > =` declaration. > > Such bug also persists in c++-ts-mode (as opposed to non-ts plain c++- > mode). I'm not sure if it's me misunderstanding something or not… Yuan, any comments? From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 May 2025 19:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 77901@debbugs.gnu.org, Konstantin Kharlamov Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174716553814938 (code B ref 77901); Tue, 13 May 2025 19:46:02 +0000 Received: (at 77901) by debbugs.gnu.org; 13 May 2025 19:45:38 +0000 Received: from localhost ([127.0.0.1]:34438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEvZJ-0003sp-CU for submit@debbugs.gnu.org; Tue, 13 May 2025 15:45:38 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:55314) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uEvZH-0003rn-4B for 77901@debbugs.gnu.org; Tue, 13 May 2025 15:45:36 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-30dfd9e7fa8so2601297a91.2 for <77901@debbugs.gnu.org>; Tue, 13 May 2025 12:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747165529; x=1747770329; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=itmJqHKWIDiWSTFZTa2WqprdxnyYMhHHhtw4yAySiQ8=; b=bP6BkqsLIHNI2o2U07//YE2MamzO0NbKelABEevMiTSxzjnbXQs9g7AsV+zD0K2a8D cWB4xIgx6B0ceJq8YBNrFJX67ZqLaJ7E1AJ64shlfIf5X5g7KDZjJrCySEHzXPZMNLfs gcoE2Ew31wKIjLRVKVhCZUFhHGJ2KDPiMxBhHnDYi8HBVs9lO9sQukRLH9eHgPPUC3pE 8o1s9XYS7e5xCtCKjS66yVnw16KMOj60xWANOUjEk87kpQqSOKv8BK1I9mEhQIaC6LwP 8BN8zXLn2H4IFkX5tEuM2+6BYLYWMFL/NWwhzJPF/NbhtIH57Ys7CYOLPXuuRr2yfYrO KKoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747165529; x=1747770329; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=itmJqHKWIDiWSTFZTa2WqprdxnyYMhHHhtw4yAySiQ8=; b=tWRd0arB/G5RZeeNFxbBtOscTIzQuldNUdc0DSvhT51U65wHuuElPpQnR0ncjQcOcD 6I0E7V7YK2GPJwtnOb6iV+vHDRTNyK+73cYTde5qaQzN35dH7+9zN21JwUtirEzw/Acj ljT4q7ia3DYl4nusjh2tUWkV3wg74KbI3S1pyclXpPFuJ1TsvboDAP2py4xFbIAMXlCt uWl3YhMWT1UuLz8ObClU3apO9nd+6Yq1A/f4aRbYK88v7vUPpkIhwq9/7flnY3IiFuHz SF93Rtj3RRwnZ+tXdmpajgId+qZCjfTKHVSHFyFE1rB/DB+SN/JsNLKGQd1/9BdzIjp0 ht+Q== X-Forwarded-Encrypted: i=1; AJvYcCXNmOZYoDU2nmLutH3oYG80JlL4YbOa7FBckMqVDJINDj30wzI7bMKiC2Lkikwu7mL3mOO4Xg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzpaQWYEqMZwFFw1TNOZFyRDqzhgTy9ti4jZaQOdopeA9xDN5RN MuebpZfsUptz+t2TfZV8DoeZ2G83+9MO5ILYoPsd0vNOntVwFhAu X-Gm-Gg: ASbGncsEFrOZW6k3Ou1o1UKJKoQw3UnCvBjZ4ZOWjwxEFBOMq0cYrKVhKQQhLnifVc6 v02HEZckbvjKlUiylJHuUjRjnjGrvq2gdhoW/3a426YmdAQhoc/+GQuJB55tB7LEAcu/63ve7vP WxKsWyfscA005JkcPEkZ9OfHk+mVM468Pls45SrjJ1oiiQwmK2RwFkhRF2Sryf5dt1Ux6kSyp8Y buDdbItO7CH6GNvU02ue6HXLQmhYy1m9SL7VgiQUqejpJnP4uoOBU2XFyguO2HJoyAwOAX3Iw7t hE9Vomkoz2Z2+t2BQfxWn2koTzyqZ5pJFS9nOtUMD2dV1MWjelXWlH5BTaauGUSt704l2k7rOjA = X-Google-Smtp-Source: AGHT+IGku4t+eOqsHJ8LTvyMkt8WcsvA2exuoL+FOruePeXDKm7Rq70oM+OzwGyUtU4BG9E8hJaytw== X-Received: by 2002:a17:90b:1d81:b0:2ff:4f04:4261 with SMTP id 98e67ed59e1d1-30e2e64228fmr952870a91.34.1747165528885; Tue, 13 May 2025 12:45:28 -0700 (PDT) Received: from smtpclient.apple ([2601:646:8f81:6120:fc6f:318d:bb8d:99b2]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30c39e78745sm8927019a91.49.2025.05.13.12.45.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 May 2025 12:45:28 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) From: Yuan Fu In-Reply-To: <86ikm8ahz5.fsf@gnu.org> Date: Tue, 13 May 2025 12:45:17 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) 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 (-) Hey, sorry for the delay. > On May 10, 2025, at 3:16=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: Konstantin Kharlamov >> Date: Thu, 01 May 2025 20:39:02 +0700 >>=20 >> After poking around I wrote a patch (attached). Thanks! LGTM. For some reason I can=E2=80=99t apply the patch on either = emacs-30 or master. [1] >> Worth noting though, for >> some reason it doesn't work for ternary without starting colon, e.g.: >>=20 >> const a =3D cond1 ? 1 : >> cond2 ? 2 : >> cond3 ? 3 : 4; >>=20 >> I'm unclear why, per my understanding the "standalone-parent" of the >> whole ternary chain (disregarding where the point is) is the `const a >> =3D` declaration. The standalone rule just keeps going up the parse tree until it finds a = node that starts on a new line. In this case, if you start form cond3, = it=E2=80=99ll go up until reaching the teneray_expression node = containing cond2. This node starts on a new line so standalone-parent = stops here. So the cond3 line uses the cond2 line as the anchor, instead = of the =E2=80=9Cconst a=E2=80=9D line. If you add a cond4 line, it=E2=80=99= ll use the cond3 line as anchor. There=E2=80=99re several ways to fix it. The best way is to add a new = anchor to the presets that does what standalone-parent does, but = additionally excludes some nodes. Something like = (standalone-parent-excluding =E2=80=9Cregexp=E2=80=9D). Then this can be = used for both typescript and c/c++ (and java, etc). >>=20 >> Such bug also persists in c++-ts-mode (as opposed to non-ts plain = c++- >> mode). I'm not sure if it's me misunderstanding something or not=E2=80=A6= >=20 > Yuan, any comments? Yeah we should fix this in c/c++-ts-mode too. In c/c++, the = baseline-indent-rule can handle int a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : 4; Which is nice, but the other case needs special case override: int a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : cond 4: 5; Yuan [1] I got this error: 128 git =E2=80=A6 am --3way -- /Users/yuan/downloads/1-3.patch Applying: typescript-ts: align ternary-chain branches (bug#78187) error: sha1 information is lacking or useless = (test/lisp/progmodes/typescript-ts-mode-resources/indent.erts). error: could not build fake ancestor Patch failed at 0001 typescript-ts: align ternary-chain branches = (bug#78187) hint: Use 'git am --show-current-patch=3Ddiff' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2025 14:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu , Eli Zaretskii Cc: 77901@debbugs.gnu.org Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174723427221917 (code B ref 77901); Wed, 14 May 2025 14:52:01 +0000 Received: (at 77901) by debbugs.gnu.org; 14 May 2025 14:51:12 +0000 Received: from localhost ([127.0.0.1]:44268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFDRw-0005hQ-7S for submit@debbugs.gnu.org; Wed, 14 May 2025 10:51:12 -0400 Received: from forward501a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d501]:38540) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFDRt-0005h9-DQ for 77901@debbugs.gnu.org; Wed, 14 May 2025 10:51:10 -0400 Received: from mail-nwsmtp-smtp-production-main-74.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-74.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:1a98:0:640:f7e1:0]) by forward501a.mail.yandex.net (Yandex) with ESMTPS id 4861661C1C; Wed, 14 May 2025 17:51:02 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-74.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id voIetw4LbGk0-82e2iNzc; Wed, 14 May 2025 17:51:01 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1747234261; bh=km5mZrMAHtY5mvDGbaGbCsz4QvM9U+8U445qygB75cw=; h=Date:In-Reply-To:Cc:References:To:From:Subject:Message-ID; b=smpUHwt049LPva07Q0PkVKNrKVpLw4H5Rw8wZtTnwmRjl7M4I83eR6lI8y/jyRu8Q a2/o4fr3HJdCe+G05d+c/KeWgI4NMfGSMyTOGOmU4SyOk9KJsrIC99c/HMeNvgqAGV FCluIkbgq4jmkuxIO/G//2497HXVTsYdQ3mM6Nuc= Authentication-Results: mail-nwsmtp-smtp-production-main-74.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> From: Konstantin Kharlamov Date: Wed, 14 May 2025 21:50:56 +0700 In-Reply-To: <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> Content-Type: multipart/mixed; boundary="=-tj8QVpGB3wqMMM9eZDdW" User-Agent: Evolution 3.56.1 MIME-Version: 1.0 X-Spam-Score: -0.7 (/) 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.7 (-) --=-tj8QVpGB3wqMMM9eZDdW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2025-05-13 at 12:45 -0700, Yuan Fu wrote: > Hey, sorry for the delay. > > > On May 10, 2025, at 3:16=E2=80=AFAM, Eli Zaretskii wrote= : > > > > > From: Konstantin Kharlamov > > > Date: Thu, 01 May 2025 20:39:02 +0700 > > > > > > After poking around I wrote a patch (attached). > > Thanks! LGTM. For some reason I can=E2=80=99t apply the patch on either > emacs-30 or master. [1] Oh, interesting. I kind of know where the error is coming from, but only partially. The reason for the error is that the patch I sent was applied over the patch for #78121 (which is pending btw =F0=9F=98=8A) as I'= m using them both for coding. At the same time, I don't really understand the source of the error as the same parameters work for me: =E2=95=B0=E2=94=80=CE=BB git am --3way -- /tmp/1.patch Applying: typescript-ts: align ternary-chain branches (bug#78187) Using index info to reconstruct a base tree... M lisp/progmodes/typescript-ts-mode.el M test/lisp/progmodes/typescript-ts-mode-resources/indent.erts Falling back to patching base and 3-way merge... Auto-merging test/lisp/progmodes/typescript-ts-mode-resources/indent.er= ts Auto-merging lisp/progmodes/typescript-ts-mode.el Either way, I redone the patch on top of the tree, please try this one > > > Worth noting though, for > > > some reason it doesn't work for ternary without starting colon, > > > e.g.: > > > > > > =C2=A0=C2=A0 const a =3D cond1 ? 1 : > > > =C2=A0=C2=A0=C2=A0=C2=A0 cond2 ? 2 : > > > =C2=A0=C2=A0=C2=A0=C2=A0 cond3 ? 3 : 4; > > > > > > I'm unclear why, per my understanding the "standalone-parent" of > > > the > > > whole ternary chain (disregarding where the point is) is the > > > `const a > > > =3D` declaration. > > The standalone rule just keeps going up the parse tree until it finds > a node that starts on a new line. In this case, if you start form > cond3, it=E2=80=99ll go up until reaching the teneray_expression node > containing cond2. This node starts on a new line so standalone-parent > stops here. So the cond3 line uses the cond2 line as the anchor, > instead of the =E2=80=9Cconst a=E2=80=9D line. If you add a cond4 line, i= t=E2=80=99ll use the > cond3 line as anchor. > > There=E2=80=99re several ways to fix it. The best way is to add a new anc= hor > to the presets that does what standalone-parent does, but > additionally excludes some nodes. Something like (standalone-parent- > excluding =E2=80=9Cregexp=E2=80=9D). Then this can be used for both types= cript and > c/c++ (and java, etc). Oh, I see, thank you! --=-tj8QVpGB3wqMMM9eZDdW Content-Disposition: attachment; filename="3.patch" Content-Type: text/x-patch; name="3.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJ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rlc3QvbGlzcC9wcm9nbW9kZXMvdHlwZXNjcmlwdC10cy1tb2RlLXJlc291cmNlcy9pbmRl bnQuZXJ0cwppbmRleCAxMzA1MDI5YTllMS4uZThiMWQ1N2YxMzIgMTAwNjQ0Ci0tLSBhL3Rlc3Qv bGlzcC9wcm9nbW9kZXMvdHlwZXNjcmlwdC10cy1tb2RlLXJlc291cmNlcy9pbmRlbnQuZXJ0cwor KysgYi90ZXN0L2xpc3AvcHJvZ21vZGVzL3R5cGVzY3JpcHQtdHMtbW9kZS1yZXNvdXJjZXMvaW5k ZW50LmVydHMKQEAgLTkzLDYgKzkzLDE1IEBAIGNvbnN0IGZvbyA9ICgpID0+IHsKIH07CiA9LT0t PQogCitOYW1lOiBDaGFpbmVkIHRlcm5hcnkgZXhwcmVzc2lvbnMKKworPS09Citjb25zdCBhID0g Y29uZDEgPyAxCisgIDogY29uZDIgPyAyCisgIDogY29uZDMgPyAzCisgIDogNDsKKz0tPS09CisK IENvZGU6CiAgIChsYW1iZGEgKCkKICAgICAoc2V0cSB0c3gtdHMtbW9kZS1pbmRlbnQtb2Zmc2V0 IDIpCi0tIAoyLjQ5LjAKCg== --=-tj8QVpGB3wqMMM9eZDdW-- From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 May 2025 03:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Konstantin Kharlamov Cc: 77901@debbugs.gnu.org, Eli Zaretskii Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174736515130805 (code B ref 77901); Fri, 16 May 2025 03:13:02 +0000 Received: (at 77901) by debbugs.gnu.org; 16 May 2025 03:12:31 +0000 Received: from localhost ([127.0.0.1]:59448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFlUs-00080n-TF for submit@debbugs.gnu.org; Thu, 15 May 2025 23:12:31 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:53267) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uFlUp-00080Y-QD for 77901@debbugs.gnu.org; Thu, 15 May 2025 23:12:28 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-30e57a37294so1314502a91.2 for <77901@debbugs.gnu.org>; Thu, 15 May 2025 20:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747365142; x=1747969942; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aQaTRRRT4HByFqYrptmy/slyikR76al4KQUEPeA3dCc=; b=fBydaGSbnCVwuNSQVDy833Z9Yph9/eHXKMQyWJOCHlQkATBINvwA2aV5qnHi7PMUhk 3PMyyigL7cKbJOiwQMFQhWz39OoVRpBOuWSLa+AN8z4tIpaEJqHJ5wNhyrLDlCb69+wb fdP1/DCi4BQZGgN1qVfpBF3bcVy9uFYZc7CwPxe3n+M/D6i0MW+/S9rAQdNewwhPwg9w 5/vzuItxT9TCYPVbvLQLmweas1KLYPfxbWQAQA/bp1/Jj+5kZIXhL13xydGdo2Cpe+gb XGWLQC9ZlQDRoHR83KJpKE01FuRVX03qDAY+NzNJiXnnXvBnNwYSjzeLLENQwTfMXkGL fUhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747365142; x=1747969942; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aQaTRRR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99QCZIaRtONhEw== X-Received: by 2002:a17:90b:2b45:b0:308:7a70:489a with SMTP id 98e67ed59e1d1-30e83228dcfmr1265527a91.30.1747365141620; Thu, 15 May 2025 20:12:21 -0700 (PDT) Received: from smtpclient.apple ([2601:646:8f81:6120:143f:98f:4244:3b7a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-30e8890ec44sm80754a91.36.2025.05.15.20.12.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 May 2025 20:12:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) From: Yuan Fu In-Reply-To: <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> Date: Thu, 15 May 2025 20:12:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) 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 (-) > On May 14, 2025, at 7:50=E2=80=AFAM, Konstantin Kharlamov = wrote: >=20 > On Tue, 2025-05-13 at 12:45 -0700, Yuan Fu wrote: >> Hey, sorry for the delay. >>=20 >>> On May 10, 2025, at 3:16=E2=80=AFAM, Eli Zaretskii = wrote: >>>=20 >>>> From: Konstantin Kharlamov >>>> Date: Thu, 01 May 2025 20:39:02 +0700 >>>>=20 >>>> After poking around I wrote a patch (attached). >>=20 >> Thanks! LGTM. For some reason I can=E2=80=99t apply the patch on = either >> emacs-30 or master. [1] >=20 > Oh, interesting. I kind of know where the error is coming from, but > only partially. The reason for the error is that the patch I sent was > applied over the patch for #78121 (which is pending btw =F0=9F=98=8A) = as I'm > using them both for coding. At the same time, I don't really > understand the source of the error as the same parameters work for me: >=20 > =E2=95=B0=E2=94=80=CE=BB git am --3way -- /tmp/1.patch > Applying: typescript-ts: align ternary-chain branches (bug#78187) > Using index info to reconstruct a base tree... > M lisp/progmodes/typescript-ts-mode.el > M = test/lisp/progmodes/typescript-ts-mode-resources/indent.erts > Falling back to patching base and 3-way merge... > Auto-merging = test/lisp/progmodes/typescript-ts-mode-resources/indent.erts > Auto-merging lisp/progmodes/typescript-ts-mode.el >=20 > Either way, I redone the patch on top of the tree, please try this one Thanks, this works. I applied it on emacs-30. BTW, each entry in the = commit message needs to be prefixed with =E2=80=9C*=E2=80=9D. Are you = using magit? You can just type =E2=80=9CC=E2=80=9D in the magit diff = buffer and it=E2=80=99ll insert changelog entries for you into the = commit message buffer. >>>> Worth noting though, for >>>> some reason it doesn't work for ternary without starting colon, >>>> e.g.: >>>>=20 >>>> const a =3D cond1 ? 1 : >>>> cond2 ? 2 : >>>> cond3 ? 3 : 4; >>>>=20 >>>> I'm unclear why, per my understanding the "standalone-parent" of >>>> the >>>> whole ternary chain (disregarding where the point is) is the >>>> `const a >>>> =3D` declaration. >>=20 >> The standalone rule just keeps going up the parse tree until it finds >> a node that starts on a new line. In this case, if you start form >> cond3, it=E2=80=99ll go up until reaching the teneray_expression node >> containing cond2. This node starts on a new line so standalone-parent >> stops here. So the cond3 line uses the cond2 line as the anchor, >> instead of the =E2=80=9Cconst a=E2=80=9D line. If you add a cond4 = line, it=E2=80=99ll use the >> cond3 line as anchor. >>=20 >> There=E2=80=99re several ways to fix it. The best way is to add a new = anchor >> to the presets that does what standalone-parent does, but >> additionally excludes some nodes. Something like (standalone-parent- >> excluding =E2=80=9Cregexp=E2=80=9D). Then this can be used for both = typescript and >> c/c++ (and java, etc). >=20 > Oh, I see, thank you! Unless you intend to work on this (which will be great ;-), I=E2=80=99ll = add it when I find time. Yuan From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 May 2025 06:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: 77901@debbugs.gnu.org, Eli Zaretskii Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174737655612684 (code B ref 77901); Fri, 16 May 2025 06:23:02 +0000 Received: (at 77901) by debbugs.gnu.org; 16 May 2025 06:22:36 +0000 Received: from localhost ([127.0.0.1]:32937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFoSp-0003IW-Jj for submit@debbugs.gnu.org; Fri, 16 May 2025 02:22:36 -0400 Received: from forward500a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d500]:51584) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFoSm-0003Hu-Re for 77901@debbugs.gnu.org; Fri, 16 May 2025 02:22:33 -0400 Received: from mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:c08b:0:640:4d3c:0]) by forward500a.mail.yandex.net (Yandex) with ESMTPS id A80E661329; Fri, 16 May 2025 09:22:25 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id JMCd2R5LcKo0-2YKATYvt; Fri, 16 May 2025 09:22:24 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1747376545; bh=zpxVUrQA9k5g49ORf03Tpj+WXcl1blzsA6EqRQzhu2Q=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=Z0aROw1IOxT1Yxc/ovIHb364pma+3DitlCw9dU2jSYPwSyoR+IhY/zBcFimt064e+ Vg6pBqPgHJXpjImhWiKu7S0PGsF4vSS7yMLlIGOdP8Z20qqT7r/TKmvvBR177LIWRl DeYI5K/yD7Li910c/W424FNAZe2juaj8hMee6qDw= Authentication-Results: mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> From: Konstantin Kharlamov Date: Fri, 16 May 2025 13:22:19 +0700 In-Reply-To: <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.1 MIME-Version: 1.0 X-Spam-Score: -0.7 (/) 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.7 (-) On Thu, 2025-05-15 at 20:12 -0700, Yuan Fu wrote: >=20 >=20 > > On May 14, 2025, at 7:50=E2=80=AFAM, Konstantin Kharlamov > > wrote: > >=20 > > On Tue, 2025-05-13 at 12:45 -0700, Yuan Fu wrote: > > > Hey, sorry for the delay. > > >=20 > > > > On May 10, 2025, at 3:16=E2=80=AFAM, Eli Zaretskii > > > > wrote: > > > >=20 > > > > > From: Konstantin Kharlamov > > > > > Date: Thu, 01 May 2025 20:39:02 +0700 > > > > >=20 > > > > > After poking around I wrote a patch (attached). > > >=20 > > > Thanks! LGTM. For some reason I can=E2=80=99t apply the patch on eith= er > > > emacs-30 or master. [1] > >=20 > > Oh, interesting.=C2=A0 I kind of know where the error is coming from, > > but > > only partially.=C2=A0 The reason for the error is that the patch I sent > > was > > applied over the patch for #78121 (which is pending btw =F0=9F=98=8A) a= s I'm > > using them both for coding.=C2=A0=C2=A0 At the same time, I don't reall= y > > understand the source of the error as the same parameters work for > > me: > >=20 > > =C2=A0=C2=A0 =E2=95=B0=E2=94=80=CE=BB git am --3way -- /tmp/1.patch > > =C2=A0=C2=A0 Applying: typescript-ts: align ternary-chain branches > > (bug#78187) > > =C2=A0=C2=A0 Using index info to reconstruct a base tree... > > =C2=A0=C2=A0 M=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lisp/progmodes/types= cript-ts-mode.el > > =C2=A0=C2=A0 M=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 test/lisp/progmodes/= typescript-ts-mode- > > resources/indent.erts > > =C2=A0=C2=A0 Falling back to patching base and 3-way merge... > > =C2=A0=C2=A0 Auto-merging test/lisp/progmodes/typescript-ts-mode- > > resources/indent.erts > > =C2=A0=C2=A0 Auto-merging lisp/progmodes/typescript-ts-mode.el > >=20 > > Either way, I redone the patch on top of the tree, please try this > > one >=20 > Thanks, this works. I applied it on emacs-30. BTW, each entry in the > commit message needs to be prefixed with =E2=80=9C*=E2=80=9D.=C2=A0 Oh, sorry, apparently I forgot it while writing this message. > Are you using magit? You can just type =E2=80=9CC=E2=80=9D in the magit d= iff buffer > and it=E2=80=99ll insert changelog entries for you into the commit messag= e > buffer. I use magit, though just for the highlight. I just tried your suggestion: invoked emacs with `git commit --amend` for the discussed commit, switched to the diff buffer and tried pressing "c" and "C". Lower-case "c" just switches me to "COMMIT_EDITMSG" buffer. Upper-case "C" pops up an interactive question about cloning from a URL. I don't know if I'm missing something, but neither seems to insert the changelog entries. > > > > > Worth noting though, for > > > > > some reason it doesn't work for ternary without starting > > > > > colon, > > > > > e.g.: > > > > >=20 > > > > > =C2=A0=C2=A0 const a =3D cond1 ? 1 : > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 cond2 ? 2 : > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 cond3 ? 3 : 4; > > > > >=20 > > > > > I'm unclear why, per my understanding the "standalone-parent" > > > > > of > > > > > the > > > > > whole ternary chain (disregarding where the point is) is the > > > > > `const a > > > > > =3D` declaration. > > >=20 > > > The standalone rule just keeps going up the parse tree until it > > > finds > > > a node that starts on a new line. In this case, if you start form > > > cond3, it=E2=80=99ll go up until reaching the teneray_expression node > > > containing cond2. This node starts on a new line so standalone- > > > parent > > > stops here. So the cond3 line uses the cond2 line as the anchor, > > > instead of the =E2=80=9Cconst a=E2=80=9D line. If you add a cond4 lin= e, it=E2=80=99ll use > > > the > > > cond3 line as anchor. > > >=20 > > > There=E2=80=99re several ways to fix it. The best way is to add a new > > > anchor > > > to the presets that does what standalone-parent does, but > > > additionally excludes some nodes. Something like (standalone- > > > parent- > > > excluding =E2=80=9Cregexp=E2=80=9D). Then this can be used for both t= ypescript > > > and > > > c/c++ (and java, etc). > >=20 > > Oh, I see, thank you! >=20 > Unless you intend to work on this (which will be great ;-), I=E2=80=99ll = add > it when I find time. Hahah, well, it's really the same for me =F0=9F=98=8A I might dig into it, = but this depends on my time =F0=9F=98=8A From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 May 2025 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Konstantin Kharlamov Cc: 77901@debbugs.gnu.org, casouri@gmail.com Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174747665825037 (code B ref 77901); Sat, 17 May 2025 10:11:02 +0000 Received: (at 77901) by debbugs.gnu.org; 17 May 2025 10:10:58 +0000 Received: from localhost ([127.0.0.1]:46090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGEVN-0006Vk-EU for submit@debbugs.gnu.org; Sat, 17 May 2025 06:10:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54830) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGEVK-0006VU-TC for 77901@debbugs.gnu.org; Sat, 17 May 2025 06:10:55 -0400 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 1uGEVE-0005bM-SR; Sat, 17 May 2025 06:10:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=x54Y8sJIcVNK29M0GIV8TmKDPivutmqv6FYluxjZxYU=; b=bMyMvc7qoT4uozIYGK76 3lroQNKmGZvI1q8RuqQ4yHSiJmKhit5ZvisAhDwXwPvvrpbL+k9PM4rk6rGK9SJXejlm9LBOTA5S9 YHZd2gJ3/Hp/6f7mzi5aII+CwUF/xKSXVN3meZKQTaY4STofp+wevQH9E+gfKUxFlynEisSCHBIQw cAutJr0W61mRaQql7CpqWPmFAST5JbT26w+YhDw6Ff58ULCEvHXJyBSRw/wJN4lL9ZUi08v63fJAe NlNI7FqSSLmgjPfGA3V0Bnc5JYZPtuc3MpL+6YF/ccnse9ldK8NlJqRr1LIPkhbe56ONaBmBgU9Db F5bjQILuWfIUqQ==; Date: Sat, 17 May 2025 13:10:45 +0300 Message-Id: <86wmafv97e.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> (message from Konstantin Kharlamov on Fri, 16 May 2025 13:22:19 +0700) References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Konstantin Kharlamov > Cc: Eli Zaretskii , 77901@debbugs.gnu.org > Date: Fri, 16 May 2025 13:22:19 +0700 > > On Thu, 2025-05-15 at 20:12 -0700, Yuan Fu wrote: > > > > > > > On May 14, 2025, at 7:50 AM, Konstantin Kharlamov > > > wrote: > > > > > > On Tue, 2025-05-13 at 12:45 -0700, Yuan Fu wrote: > > > > Hey, sorry for the delay. > > > > > > > > > On May 10, 2025, at 3:16 AM, Eli Zaretskii > > > > > wrote: > > > > > > > > > > > From: Konstantin Kharlamov > > > > > > Date: Thu, 01 May 2025 20:39:02 +0700 > > > > > > > > > > > > After poking around I wrote a patch (attached). > > > > > > > > Thanks! LGTM. For some reason I can’t apply the patch on either > > > > emacs-30 or master. [1] > > > > > > Oh, interesting.  I kind of know where the error is coming from, > > > but > > > only partially.  The reason for the error is that the patch I sent > > > was > > > applied over the patch for #78121 (which is pending btw 😊) as I'm > > > using them both for coding.   At the same time, I don't really > > > understand the source of the error as the same parameters work for > > > me: > > > > > >    ╰─λ git am --3way -- /tmp/1.patch > > >    Applying: typescript-ts: align ternary-chain branches > > > (bug#78187) > > >    Using index info to reconstruct a base tree... > > >    M       lisp/progmodes/typescript-ts-mode.el > > >    M       test/lisp/progmodes/typescript-ts-mode- > > > resources/indent.erts > > >    Falling back to patching base and 3-way merge... > > >    Auto-merging test/lisp/progmodes/typescript-ts-mode- > > > resources/indent.erts > > >    Auto-merging lisp/progmodes/typescript-ts-mode.el > > > > > > Either way, I redone the patch on top of the tree, please try this > > > one > > > > Thanks, this works. I applied it on emacs-30. BTW, each entry in the > > commit message needs to be prefixed with “*”.  > > Oh, sorry, apparently I forgot it while writing this message. > > > Are you using magit? You can just type “C” in the magit diff buffer > > and it’ll insert changelog entries for you into the commit message > > buffer. > > I use magit, though just for the highlight. I just tried your > suggestion: invoked emacs with `git commit --amend` for the discussed > commit, switched to the diff buffer and tried pressing "c" and "C". > > Lower-case "c" just switches me to "COMMIT_EDITMSG" buffer. Upper-case > "C" pops up an interactive question about cloning from a URL. > > I don't know if I'm missing something, but neither seems to insert the > changelog entries. > > > > > > > Worth noting though, for > > > > > > some reason it doesn't work for ternary without starting > > > > > > colon, > > > > > > e.g.: > > > > > > > > > > > >    const a = cond1 ? 1 : > > > > > >      cond2 ? 2 : > > > > > >      cond3 ? 3 : 4; > > > > > > > > > > > > I'm unclear why, per my understanding the "standalone-parent" > > > > > > of > > > > > > the > > > > > > whole ternary chain (disregarding where the point is) is the > > > > > > `const a > > > > > > =` declaration. > > > > > > > > The standalone rule just keeps going up the parse tree until it > > > > finds > > > > a node that starts on a new line. In this case, if you start form > > > > cond3, it’ll go up until reaching the teneray_expression node > > > > containing cond2. This node starts on a new line so standalone- > > > > parent > > > > stops here. So the cond3 line uses the cond2 line as the anchor, > > > > instead of the “const a” line. If you add a cond4 line, it’ll use > > > > the > > > > cond3 line as anchor. > > > > > > > > There’re several ways to fix it. The best way is to add a new > > > > anchor > > > > to the presets that does what standalone-parent does, but > > > > additionally excludes some nodes. Something like (standalone- > > > > parent- > > > > excluding “regexp”). Then this can be used for both typescript > > > > and > > > > c/c++ (and java, etc). > > > > > > Oh, I see, thank you! > > > > Unless you intend to work on this (which will be great ;-), I’ll add > > it when I find time. > > Hahah, well, it's really the same for me 😊 I might dig into it, but > this depends on my time 😊 Should this bug be closed now? From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 May 2025 16:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 77901@debbugs.gnu.org, casouri@gmail.com Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174750053711290 (code B ref 77901); Sat, 17 May 2025 16:49:02 +0000 Received: (at 77901) by debbugs.gnu.org; 17 May 2025 16:48:57 +0000 Received: from localhost ([127.0.0.1]:50528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGKiW-0002w2-RZ for submit@debbugs.gnu.org; Sat, 17 May 2025 12:48:57 -0400 Received: from forward502a.mail.yandex.net ([178.154.239.82]:55890) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGKiU-0002vj-M7 for 77901@debbugs.gnu.org; Sat, 17 May 2025 12:48:55 -0400 Received: from mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:1014:0:640:8592:0]) by forward502a.mail.yandex.net (Yandex) with ESMTPS id 8696560E66; Sat, 17 May 2025 19:48:47 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id gmNT5vNLZiE0-Xt0aEu4y; Sat, 17 May 2025 19:48:46 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1747500527; bh=uCNyeF2HjGr41c/zSTF06WxUPaYUcCQetzGgT6q2uAI=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=vYwQkvu+rcbGcYPfCbl3aay/bngxFcNgiLboZjkdyMyq5pJdDnDNcEEoDwe3khMQs Dzdu6VDtlndCOzicq19c6onWnGzrE1M3Czf1Ym8JiBIG0zI2LJ1JKOfLcyz+ycp7b8 fGJ5BTIMyRHurekyaigWTz+0sSCJCYkZ9WSAhd0U= Authentication-Results: mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <7546d839701b5ff00d4c31c82167276e358a03c9.camel@yandex.ru> From: Konstantin Kharlamov Date: Sat, 17 May 2025 23:48:41 +0700 In-Reply-To: <86wmafv97e.fsf@gnu.org> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> <86wmafv97e.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.1 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) 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 (-) On Sat, 2025-05-17 at 13:10 +0300, Eli Zaretskii wrote: > Should this bug be closed now? Well, my problem is solved, because I use style where colons start the line. But if someone uses style where colons remain on the previous line, more work is needed. I guess it makes sense to keep an issue for such case, the question only if it should go to its own issue, or may be solved here as well. From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 May 2025 18:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Konstantin Kharlamov Cc: 77901@debbugs.gnu.org, casouri@gmail.com Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.17475071122862 (code B ref 77901); Sat, 17 May 2025 18:39:02 +0000 Received: (at 77901) by debbugs.gnu.org; 17 May 2025 18:38:32 +0000 Received: from localhost ([127.0.0.1]:50971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGMQZ-0000k6-MH for submit@debbugs.gnu.org; Sat, 17 May 2025 14:38:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51630) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGMQW-0000jo-QU for 77901@debbugs.gnu.org; Sat, 17 May 2025 14:38:29 -0400 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 1uGMQQ-0004B8-Ir; Sat, 17 May 2025 14:38:22 -0400 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=R1ur1diZhRdYKfxCQl7FE19WFULWw7wac8fTnKXhk3Y=; b=XJCzGA+NFulD PdwEEc3RlApf87RgpKjb/te5nZ7tpS17i0aIi2sRdtrCVWs2huFOT6KJPK8hthcS3ZyREuGIZQmsk T6W2A+ekZWc8BMPG7PcIUASyKbfzf6D//n9kA/0veBVr7k0Y5Z8JUuOFCvNdAs7+474QtGVEVmYMS dRZH8cqYqdSJ3wrs2oGXLC6oRVp8wRVQ4/w6TvFTIxSWUR8qE4wfHDPQxf+bJ/Ax6iE3KU9Px4Tfi 6vUdLzcCScXnZI9CfmelLqGQ4dr2wt6LUYrpZAa7iVgffk1mSN8MY7N/C6pDm9UT0Csyks05+2LUi VdcGZF6g7Sq4zqek8ywKbQ==; Date: Sat, 17 May 2025 21:37:39 +0300 Message-Id: <86a57bulqk.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <7546d839701b5ff00d4c31c82167276e358a03c9.camel@yandex.ru> (message from Konstantin Kharlamov on Sat, 17 May 2025 23:48:41 +0700) References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> <86wmafv97e.fsf@gnu.org> <7546d839701b5ff00d4c31c82167276e358a03c9.camel@yandex.ru> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Konstantin Kharlamov > Cc: casouri@gmail.com, 77901@debbugs.gnu.org > Date: Sat, 17 May 2025 23:48:41 +0700 > > On Sat, 2025-05-17 at 13:10 +0300, Eli Zaretskii wrote: > > Should this bug be closed now? > > Well, my problem is solved, because I use style where colons start the > line. But if someone uses style where colons remain on the previous > line, more work is needed. I guess it makes sense to keep an issue for > such case, the question only if it should go to its own issue, or may > be solved here as well. My question is, if we keep this open, who and how (and when) will close it? From unknown Fri Jun 13 11:10:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77901: tsx-ts-mode: ternary chains are indented as a tree Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 May 2025 06:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 77901@debbugs.gnu.org, Konstantin Kharlamov Received: via spool by 77901-submit@debbugs.gnu.org id=B77901.174780824710363 (code B ref 77901); Wed, 21 May 2025 06:18:02 +0000 Received: (at 77901) by debbugs.gnu.org; 21 May 2025 06:17:27 +0000 Received: from localhost ([127.0.0.1]:43071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHcla-0002h4-T5 for submit@debbugs.gnu.org; Wed, 21 May 2025 02:17:27 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:44474) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uHclW-0002gm-TY for 77901@debbugs.gnu.org; Wed, 21 May 2025 02:17:23 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-742af84818cso3822640b3a.1 for <77901@debbugs.gnu.org>; Tue, 20 May 2025 23:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747808236; x=1748413036; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bY0zb35ryZtdv8LBUeydyUjwL4cuXU5cjZK4Pwgo/UY=; b=gQjVBEWiQb6i9LGvjPm80XI7CjAp1oB+fSaspk8Ixc3pBdFy8Qxy9LyxUacwlIDwcj vQnbTO9FhTd+2g86R+I+6auNz+ojObg04hkVZV9hGevW1dSIkKQ+kq4M2T6rDhTADv2I SOnWuFppYSNFQiwNYB0pBEibS4VdVBo9OLP6EVfxs7ZcAq9SMlQdd2UgSfBocBwFnpGF 7pEz5KU1U89JwovBd2IPiCAMQSzjcWEHUSbUhdd/0u8OE9z/B6ir6tVltJB5M0IkacD8 nTjW5aPUzyDQxYLQKJxAicXxFiqN1MXtxQIXPLkutroPZavX6XvajVgWsI52y2cqhF4x zdKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747808236; x=1748413036; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bY0zb35ryZtdv8LBUeydyUjwL4cuXU5cjZK4Pwgo/UY=; b=m++7ChgRSrppZS5E3l3jnlmrnd17AvvFoNb+MDiLylX5SNOHrTisNpnmRpTLvoHZU7 OuyNaJ4g5kHvaHg3DMGLR5N7TW57Tc721VGaDkYFGCndj7PR5D5/++IKlHFw7dzsqHAl /RdbWuj1ZovbCB5aQS3rCl7ktg6u3BDRsRcPDzEc4ZZnSFCbNN/kDgsi9+eZYP8GLAHv MV/xAhKgMS0yTFHNVvl4ud6F9hJ04OZnu5d8F2Pv/e78pafYoG5q9GMKUVaEW2dpePtF PJxol+AKvHAhpJED3QrKURMPNXMaNZ7lw22YKQYH4DZ70+6dBdjfW47gEarK2jmQi3SM 2sWg== X-Forwarded-Encrypted: i=1; AJvYcCVTGMqtQVNW4FcSHvcuG0ljw0eo/EGoghxcetLzLlpKh1K0ANhnfYI886VUGiNccyq08XXI0Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyLcpyIpyYTaxQeRTvvXJaTJYPZUfRtNbfZWKZPb29GVuQqhbFK mwDl3UOFf5LELEIcUK8DueM1SMtPLkz+FAimmZDF71k+/hvf2VaDhww4 X-Gm-Gg: ASbGncs6ieHen7X8zTA2iZmFtQyFvGgIgPn6K0MydoZ4rUHljRU2VSNeWRS6Q2KEPHK 7eR4CJLWaj7soqvynTBFZDCFvCMQAA6vMJSkdRfGR93Xhqgy3iwycCmSPw93VBO+1Z6rA0+GQKV el9fdzhpHvwaSkJ9dY3t0eEGnJqKmEEIUCK+HRbZvJJJ31Xu7+NwWXkMVCgUg+kWg9bC/0uyL1W e62sKdFx6TfPqHaDr9klTeBtjiDh4XYekR+x7yVynbE9sMMocRhCwq55iaMvkgks0pET5EtsSoc ZNp3kndC2eKZrpiA2l4NBY8G7F5rboI1OXCnB9OVPW2jvIvOxKm6XYzNF1/jHjaPaULORvQBnUf JKaiA4KzUi5D7ZWIOr9DVa+TcWgg1pW+1eTW8b6GM X-Google-Smtp-Source: AGHT+IE4yFDYEvcV0F88AZrwcW6X58Xn2c5st6grfWe2z8XfjUTE6c/L8J/b7lUvVRNhDKilUkGHag== X-Received: by 2002:aa7:88d4:0:b0:73e:2d76:9eb1 with SMTP id d2e1a72fcca58-742a97e9b89mr24614723b3a.10.1747808236251; Tue, 20 May 2025 23:17:16 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-742a973a2f8sm8863697b3a.81.2025.05.20.23.17.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 May 2025 23:17:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) From: Yuan Fu In-Reply-To: <86a57bulqk.fsf@gnu.org> Date: Tue, 20 May 2025 23:17:04 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <83BF2C62-5935-4622-AD57-EFDE3F4C6CF6@gmail.com> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> <86wmafv97e.fsf@gnu.org> <7546d839701b5ff00d4c31c82167276e358a03c9.camel@yandex.ru> <86a57bulqk.fsf@gnu.org> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) 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 (-) > On May 17, 2025, at 11:37=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: Konstantin Kharlamov >> Cc: casouri@gmail.com, 77901@debbugs.gnu.org >> Date: Sat, 17 May 2025 23:48:41 +0700 >>=20 >> On Sat, 2025-05-17 at 13:10 +0300, Eli Zaretskii wrote: >>> Should this bug be closed now? >>=20 >> Well, my problem is solved, because I use style where colons start = the >> line. But if someone uses style where colons remain on the previous >> line, more work is needed. I guess it makes sense to keep an issue = for >> such case, the question only if it should go to its own issue, or may >> be solved here as well. >=20 > My question is, if we keep this open, who and how (and when) will > close it? I=E2=80=99ll close it. But give me sometimes since I=E2=80=99m busy in = real life right now ;-) Yuan= From unknown Fri Jun 13 11:10:58 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Konstantin Kharlamov Subject: bug#77901: closed (Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree) Message-ID: References: <4569E7A9-D209-42BF-A4BF-D616FA13B01C@gmail.com> <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> X-Gnu-PR-Message: they-closed 77901 X-Gnu-PR-Package: emacs Reply-To: 77901@debbugs.gnu.org Date: Sun, 01 Jun 2025 23:18:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1748819882-7434-1" This is a multi-part message in MIME format... ------------=_1748819882-7434-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #77901: tsx-ts-mode: ternary chains are indented as a tree which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 77901@debbugs.gnu.org. --=20 77901: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D77901 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1748819882-7434-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 77901-done) by debbugs.gnu.org; 1 Jun 2025 23:17:27 +0000 Received: from localhost ([127.0.0.1]:43294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uLrvj-0001u0-2J for submit@debbugs.gnu.org; Sun, 01 Jun 2025 19:17:27 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:55765) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uLrvg-0001tO-PW for 77901-done@debbugs.gnu.org; Sun, 01 Jun 2025 19:17:25 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-742b614581dso3722265b3a.3 for <77901-done@debbugs.gnu.org>; Sun, 01 Jun 2025 16:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748819839; x=1749424639; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=f9ltMI3X2oTroYh96UfwQpGm5q5xQJP+sCJpRoUyg1E=; b=SQ/B7AsLKaHnyaAMK3p5PvLg4KfTPW/F5SgKGqNS47pzZlLQYJo2wdpWAqq8Hs1Sg3 0ie+lVaZgMN4G0uOxkX80PVhVfnv9F/odVQp7bQJPEKLoSy2Uqg93TnPdjwLEbEiKaUL SfZeNiSqcvof/7/BqImabC6Zt6tHF2l0zVCMo2iNk7SBiuT40dFfRfuzxOBs5LFMn1ws m8BKjTS2xSSwxiE0tThAOMsDa2rkNCZNfsgF/tuaLXeVZnajCoAdQlxRM2WJ187FfwAp PDQ6z9b3g9JM9uSLrhhetFTSoTwk6wXDW1nQNd8JnxWe5Tg7O1oPQIviG9P5ivb6hbAX WmkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748819839; x=1749424639; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f9ltMI3X2oTroYh96UfwQpGm5q5xQJP+sCJpRoUyg1E=; b=QiqHNf6Q6IGQhd1sLJkSbmacO8X8g8A350i6McRQr7Q7NYStLF1Eu9tcqVNmzWXyLh xG1T6PelLTDP5QOvEFI9PEOCErOPDxjDp8E6gmUkhJ/CJnEJRtxYRCHI9TLSzLTqR4Se JQtCn9JQ7C3Oy3NGx5l7E8YXWUzlEQYs+cpimwW52Pzv+XpoYniKPlrGh3lPwLV2vOo7 huv1OcezZ5QQEPfpaX7aAPYTBS4Fa9M+jzt6ukblv1KMl8LFC5xRwDEiWouB7hhzu2ng BwzL3HGix77k5nPbAgp0Q5kseX/ModkVafqRnTdWcV3NPUxG2FE8bC56rmMblryLbz5r U5dg== X-Forwarded-Encrypted: i=1; AJvYcCXSEu5Pcz4oD3P4LQ54TWegLVJJ4FsGmjL+eL/sf1CaV45fMxdTCKgT4pVS6udp2AqxytNuETG984jL@debbugs.gnu.org X-Gm-Message-State: AOJu0YyasDmaJErO7MwD7EoVSB8ISGo6ZFygtqoaCJrumBI0XYhYwCJN v8ZkxMrjCOiPze8+UUJhOXB0M32js6CxBy5msetClHnkULnhclikVvzD X-Gm-Gg: ASbGncv/qe9J5J7DpnKIuxyRkdXd6zXcqCal4MYTA7Ew5qQt74S4qW90xSytpYVvh++ rOTvDFhRPQjIC+/JE7hdS7Dmq7bB/XuA9zdV6KatqPHmnu1w5CPDW9g20zWXpTX5Z78dobk2ogM sMUFlxmTZ/ansR4+9iG0rLOIrYYP9S4k3sVsITaPmyUN17FBGflpkFtAc82vNplMRbHn1NAdNSR YYJp+BULXMq4fwKWZHdlvpwgftdDVCE/SA/DXRmV+ASLyTmwaiJZZufKKiSW3YD0GmkRGi37BYB 7gIbYMyl9ZHav65cpmlMbENZDiuLnY0BU5YLcqHQIlAYNTEACI48T4wMWW5qEL9ZHEMM8CWjQ6q V4ZamXna3XLwZRETxQELQZ6Ck1uQ0L0PIV0k= X-Google-Smtp-Source: AGHT+IF0t8XsXYvq6oXUa5GiKum9T0azJ7wRJc81UQuB2GmMpbRL1S8LLqC0I4Mxhei29mPDIN/kYA== X-Received: by 2002:a05:6a20:4394:b0:219:b652:85bb with SMTP id adf61e73a8af0-21adfd7b65amr15143218637.0.1748819838631; Sun, 01 Jun 2025 16:17:18 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-747affd4398sm6602911b3a.134.2025.06.01.16.17.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jun 2025 16:17:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Subject: Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree From: Yuan Fu In-Reply-To: <83BF2C62-5935-4622-AD57-EFDE3F4C6CF6@gmail.com> Date: Sun, 1 Jun 2025 16:17:06 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <4569E7A9-D209-42BF-A4BF-D616FA13B01C@gmail.com> References: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> <86ikm8ahz5.fsf@gnu.org> <3E8893A9-4AEF-4422-A31D-777415EA169E@gmail.com> <78c60c4984b384b3ba4b3922105fc9aa0ed65f4a.camel@yandex.ru> <5686FF0B-FC41-403D-AB6A-4DA01002F9B5@gmail.com> <514462b5168f4805e78247aade8ea8213c7be8e3.camel@yandex.ru> <86wmafv97e.fsf@gnu.org> <7546d839701b5ff00d4c31c82167276e358a03c9.camel@yandex.ru> <86a57bulqk.fsf@gnu.org> <83BF2C62-5935-4622-AD57-EFDE3F4C6CF6@gmail.com> To: Eli Zaretskii X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77901-done Cc: 77901-done@debbugs.gnu.org, Konstantin Kharlamov 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 (-) > On May 20, 2025, at 11:17=E2=80=AFPM, Yuan Fu = wrote: >=20 >=20 >=20 >> On May 17, 2025, at 11:37=E2=80=AFAM, Eli Zaretskii = wrote: >>=20 >>> From: Konstantin Kharlamov >>> Cc: casouri@gmail.com, 77901@debbugs.gnu.org >>> Date: Sat, 17 May 2025 23:48:41 +0700 >>>=20 >>> On Sat, 2025-05-17 at 13:10 +0300, Eli Zaretskii wrote: >>>> Should this bug be closed now? >>>=20 >>> Well, my problem is solved, because I use style where colons start = the >>> line. But if someone uses style where colons remain on the previous >>> line, more work is needed. I guess it makes sense to keep an issue = for >>> such case, the question only if it should go to its own issue, or = may >>> be solved here as well. >>=20 >> My question is, if we keep this open, who and how (and when) will >> close it? >=20 > I=E2=80=99ll close it. But give me sometimes since I=E2=80=99m busy in = real life right now ;-) >=20 > Yuan Done by 8d132359d19 Yuan= ------------=_1748819882-7434-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Apr 2025 14:25:31 +0000 Received: from localhost ([127.0.0.1]:52400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5mei-0001pt-MM for submit@debbugs.gnu.org; Fri, 18 Apr 2025 10:25:28 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53554) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5meZ-0001mT-MP for submit@debbugs.gnu.org; Fri, 18 Apr 2025 10:25:21 -0400 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 1u5meT-0007Dm-RX for bug-gnu-emacs@gnu.org; Fri, 18 Apr 2025 10:25:09 -0400 Received: from forward200a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u5me5-0007l7-3a for bug-gnu-emacs@gnu.org; Fri, 18 Apr 2025 10:25:09 -0400 Received: from forward100a.mail.yandex.net (forward100a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d100]) by forward200a.mail.yandex.net (Yandex) with ESMTPS id 4DD3465BA3 for ; Fri, 18 Apr 2025 17:07:36 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0d:4d14:0:640:55f0:0]) by forward100a.mail.yandex.net (Yandex) with ESMTPS id CA3BA46EFD for ; Fri, 18 Apr 2025 17:06:35 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Y6LANB1LkCg0-bWjMD4Ro; Fri, 18 Apr 2025 17:06:35 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1744985195; bh=C6D3epvRnl3uRumKT0+588A6/2TWzRQVZ8muwR6MKrQ=; h=Date:To:From:Subject:Message-ID; b=fYq5Qg4oY1AyaUoEZaAFmmXZm68D2V2g9DqY4B8RaOYQj8x8bgyTwQ4IrzqcqqbqH CR43qfR+NLr6gs1vAbYH0mR/HD/tuWFPneMCTk77dtaHZ2oPmmlc8YkAmHRd1NPUEa 6wilc8foFEIBaufZPfWBM8XHjrBByCjD8luNZtMQ= Authentication-Results: mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <79f559025659e41f6206a411e6effcb900c96c16.camel@yandex.ru> Subject: tsx-ts-mode: ternary chains are indented as a tree From: Konstantin Kharlamov To: bug-gnu-emacs@gnu.org Date: Fri, 18 Apr 2025 17:06:34 +0300 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a02:6b8:c0e:500:1:45:d181:d200; envelope-from=hi-angel@yandex.ru; helo=forward200a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit 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 (/) Given this correctly indented code: const a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : 4; if you reindent it, it turns into: const a =3D cond1 ? 1 : cond2 ? 2 : cond3 ? 3 : 4; Basically, for every colon it increases indentation. This is different from other c-like languages (it's is indented as the first form instead), and it's also different from Python. The "tree-indentation" is not readable, so there's a reason other modes indent it as the first example. Would it be possible to change in typescript mode as well? ------------=_1748819882-7434-1--