From unknown Sat Sep 20 07:11:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60074: 30.0.50; [PATCH] Add more indent rules to js/ts-modes Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: casouri@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2022 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60074 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 60074@debbugs.gnu.org Cc: casouri@gmail.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: casouri@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.16710499105499 (code B ref -1); Wed, 14 Dec 2022 20:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2022 20:31:50 +0000 Received: from localhost ([127.0.0.1]:41431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5YPu-0001Qd-28 for submit@debbugs.gnu.org; Wed, 14 Dec 2022 15:31:50 -0500 Received: from lists.gnu.org ([209.51.188.17]:45466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5YPs-0001QX-Gf for submit@debbugs.gnu.org; Wed, 14 Dec 2022 15:31:49 -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 1p5YPs-0004PX-7v for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 15:31:48 -0500 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5YPo-0001w8-V6 for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 15:31:47 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671049902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=M32xZEdma1QZ21DXL95Lgok/vtBv8vToCEn4Iw8qoQk=; b=SeFpF9tePm0PZXWhivZ630JjqLcBuzs/alJ1TbtdUBBQSl8ATHVVzyIjBWdEVSu4/+p6iE w7pJUU5Mc0LHb0k58bGri7xPWhujDaypLhjJv86kTzV0pONB/+Ec8oIPxoxBOQIbn9NNW+ mZq7hs6J+Rhl9yNB808pfWKfOwkQU3jxsQEjuOJL8N85utqseJCOX1/eN7QqkOS4MeEOaU 7kTs7+uzo3VeYW63Dt/sq4BsVZaW1kZRDG6bFSw3OiW53UwSkSsvUaLuJty9IU/06yYO/A JbruhinB4Wa67qihkRm96AuWjZAIchs1Yz9kw41n2TrW8jjRW9mL613cdRPGLA== From: Theodor Thornhill Date: Wed, 14 Dec 2022 21:31:41 +0100 Message-ID: <875yed20cy.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=theo@thornhill.no; helo=out2.migadu.com 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain Hi Yuan! Can you install this for me? Thanks, Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-indent-rules-to-js-typescript-tsx-ts-mode.patch >From fa139fbfd150f051a2ff17ce263d83a4432c8b28 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Wed, 14 Dec 2022 21:23:33 +0100 Subject: [PATCH] Add indent rules to js/typescript/tsx-ts-mode * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Add in binary_expression and jsx_fragment. * lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules. --- lisp/progmodes/js.el | 3 +++ lisp/progmodes/typescript-ts-mode.el | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 02990813ef..8ec14cf7ad 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3445,12 +3445,15 @@ js--treesit-indent-rules ((parent-is "pair") parent-bol js-indent-level) ((parent-is "arrow_function") parent-bol js-indent-level) ((parent-is "parenthesized_expression") parent-bol js-indent-level) + ((parent-is "binary_expression") parent-bol js-indent-level) ((parent-is "class_body") parent-bol js-indent-level) ((parent-is ,switch-case) parent-bol js-indent-level) ((parent-is "statement_block") parent-bol js-indent-level) ;; JSX ((parent-is "jsx_opening_element") parent js-indent-level) + ((match "<" "jsx_fragment") parent 0) + ((parent-is "jsx_fragment") parent js-indent-level) ((node-is "jsx_closing_element") parent 0) ((node-is "jsx_text") parent js-indent-level) ((parent-is "jsx_element") parent js-indent-level) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index b8a921e9c2..e7bd65c5e2 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -92,9 +92,12 @@ typescript-ts-mode--indent-rules ((parent-is "class_body") parent-bol typescript-ts-mode-indent-offset) ((parent-is "arrow_function") parent-bol typescript-ts-mode-indent-offset) ((parent-is "parenthesized_expression") parent-bol typescript-ts-mode-indent-offset) + ((parent-is "binary_expression") parent-bol typescript-ts-mode-indent-offset) ,@(when (eq language 'tsx) `(((parent-is "jsx_opening_element") parent typescript-ts-mode-indent-offset) + ((match "<" "jsx_fragment") parent 0) + ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset) ((node-is "jsx_closing_element") parent 0) ((parent-is "jsx_element") parent typescript-ts-mode-indent-offset) ((node-is "/") parent 0) -- 2.34.1 --=-=-=-- From unknown Sat Sep 20 07:11: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: Theodor Thornhill Subject: bug#60074: closed (Re: bug#60074: 30.0.50; [PATCH] Add more indent rules to js/ts-modes) Message-ID: References: <875yed20cy.fsf@thornhill.no> X-Gnu-PR-Message: they-closed 60074 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 60074@debbugs.gnu.org Date: Wed, 14 Dec 2022 22:41:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1671057662-6266-1" This is a multi-part message in MIME format... ------------=_1671057662-6266-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #60074: 30.0.50; [PATCH] Add more indent rules to js/ts-modes 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 60074@debbugs.gnu.org. --=20 60074: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D60074 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1671057662-6266-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 60074-done) by debbugs.gnu.org; 14 Dec 2022 22:40:15 +0000 Received: from localhost ([127.0.0.1]:41979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5aQA-0001cW-NH for submit@debbugs.gnu.org; Wed, 14 Dec 2022 17:40:14 -0500 Received: from mail-pj1-f53.google.com ([209.85.216.53]:36698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5aQ8-0001cL-M4 for 60074-done@debbugs.gnu.org; Wed, 14 Dec 2022 17:40:13 -0500 Received: by mail-pj1-f53.google.com with SMTP id q17-20020a17090aa01100b002194cba32e9so827994pjp.1 for <60074-done@debbugs.gnu.org>; Wed, 14 Dec 2022 14:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=k07JRp9YnsQBH31oaHLwrV13Th9Be4XSLc+fqdxLpto=; b=nXVnLIpGO7kw8hhAZ9eeO824JabnCHZa9UhjP3lGKr1/PunWj+d8bXdCWNjQ8P8cDq 2mjBflMVy9XAOJz7+eNaGRm0Hoqd7XLZ9P+o83F8zvPN+EjM/IzTvNtS0jVPTvplk4fR a8SUP63J3UIfQhUGSgVKxE2dwK50ksDKct0evhtUSsM/hQn8dgvpJSubSMK2qn0ToMpz Uj2ids7ABbhuUB0BUfB5nVFMni83zUk2lMAng5Fs9Vu8LQWAmqmqHfhubiqR1QiEvytM ogpdmr23OsGpjRAkrZozZyAMoTjgDijl07491gtyK22cH87ffPF5fF+Lb3D0XG4oohUD Qgkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k07JRp9YnsQBH31oaHLwrV13Th9Be4XSLc+fqdxLpto=; b=reiYzwrlWj2CAwvhPBzytyvEGGDUWSJGwjzYDHnnGX9rEA8tFUiKUR9cz1eYodCz/8 soSIFvnM7NuZtyFdtnW1yyHgLDcAZBx/Vy3BKC5dPvwehzmPh4vqVzwP7g3/U2TjY0km n1y+J/UNMU2t5iZV8b7zdnk/oI6nGSCKgLMzXB2rYZRnROF37W2e5EXG//K99yaPvnCP 5OUg/I7+eYl4S9JxgAOWbaF1L0JQZnphZOPyTWWz9Kx4bkT9BPYpDIbEYLmjHXuzuB3t febeHkdJakmMHTRPdRp4638sSo6ztUOVRFsCGpVe46RJ+OHGKeg+VF1yg/gn7eWWcVrJ J2aQ== X-Gm-Message-State: ANoB5pk4Jez3vy0GYOaPdB/y/3S4xZb7NnyF+CC+rdzTNypkfn2wzRqN hakfgo3OTto01NgapPZWGIA= X-Google-Smtp-Source: AA0mqf5nPxtl8b1SFSLj4yCLcR1+J1uw0D2snXk4AMv9gawaBb9XlFWIKq2p7cOE2iNhAeFT95XT5A== X-Received: by 2002:a17:903:1209:b0:185:441e:90b4 with SMTP id l9-20020a170903120900b00185441e90b4mr37321632plh.26.1671057606871; Wed, 14 Dec 2022 14:40:06 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id c2-20020a63ef42000000b00478c48cf73csm309444pgk.82.2022.12.14.14.40.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Dec 2022 14:40:06 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60074: 30.0.50; [PATCH] Add more indent rules to js/ts-modes Message-Id: Date: Wed, 14 Dec 2022 14:40:05 -0800 To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60074-done Cc: 60074-done@debbugs.gnu.org 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 (-) Theodor Thornhill writes: > Hi Yuan! > > Can you install this for me? > > Thanks, > > Theo Absolutely, I applied the patch, thanks! Yuan ------------=_1671057662-6266-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Dec 2022 20:31:50 +0000 Received: from localhost ([127.0.0.1]:41431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5YPu-0001Qd-28 for submit@debbugs.gnu.org; Wed, 14 Dec 2022 15:31:50 -0500 Received: from lists.gnu.org ([209.51.188.17]:45466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5YPs-0001QX-Gf for submit@debbugs.gnu.org; Wed, 14 Dec 2022 15:31:49 -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 1p5YPs-0004PX-7v for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 15:31:48 -0500 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5YPo-0001w8-V6 for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 15:31:47 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671049902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=M32xZEdma1QZ21DXL95Lgok/vtBv8vToCEn4Iw8qoQk=; b=SeFpF9tePm0PZXWhivZ630JjqLcBuzs/alJ1TbtdUBBQSl8ATHVVzyIjBWdEVSu4/+p6iE w7pJUU5Mc0LHb0k58bGri7xPWhujDaypLhjJv86kTzV0pONB/+Ec8oIPxoxBOQIbn9NNW+ mZq7hs6J+Rhl9yNB808pfWKfOwkQU3jxsQEjuOJL8N85utqseJCOX1/eN7QqkOS4MeEOaU 7kTs7+uzo3VeYW63Dt/sq4BsVZaW1kZRDG6bFSw3OiW53UwSkSsvUaLuJty9IU/06yYO/A JbruhinB4Wa67qihkRm96AuWjZAIchs1Yz9kw41n2TrW8jjRW9mL613cdRPGLA== From: Theodor Thornhill To: bug-gnu-emacs@gnu.org Subject: 30.0.50; [PATCH] Add more indent rules to js/ts-modes X-Debbugs-Cc: casouri@gmail.com Date: Wed, 14 Dec 2022 21:31:41 +0100 Message-ID: <875yed20cy.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=theo@thornhill.no; helo=out2.migadu.com 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain Hi Yuan! Can you install this for me? Thanks, Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-indent-rules-to-js-typescript-tsx-ts-mode.patch >From fa139fbfd150f051a2ff17ce263d83a4432c8b28 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Wed, 14 Dec 2022 21:23:33 +0100 Subject: [PATCH] Add indent rules to js/typescript/tsx-ts-mode * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Add in binary_expression and jsx_fragment. * lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules. --- lisp/progmodes/js.el | 3 +++ lisp/progmodes/typescript-ts-mode.el | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 02990813ef..8ec14cf7ad 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3445,12 +3445,15 @@ js--treesit-indent-rules ((parent-is "pair") parent-bol js-indent-level) ((parent-is "arrow_function") parent-bol js-indent-level) ((parent-is "parenthesized_expression") parent-bol js-indent-level) + ((parent-is "binary_expression") parent-bol js-indent-level) ((parent-is "class_body") parent-bol js-indent-level) ((parent-is ,switch-case) parent-bol js-indent-level) ((parent-is "statement_block") parent-bol js-indent-level) ;; JSX ((parent-is "jsx_opening_element") parent js-indent-level) + ((match "<" "jsx_fragment") parent 0) + ((parent-is "jsx_fragment") parent js-indent-level) ((node-is "jsx_closing_element") parent 0) ((node-is "jsx_text") parent js-indent-level) ((parent-is "jsx_element") parent js-indent-level) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index b8a921e9c2..e7bd65c5e2 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -92,9 +92,12 @@ typescript-ts-mode--indent-rules ((parent-is "class_body") parent-bol typescript-ts-mode-indent-offset) ((parent-is "arrow_function") parent-bol typescript-ts-mode-indent-offset) ((parent-is "parenthesized_expression") parent-bol typescript-ts-mode-indent-offset) + ((parent-is "binary_expression") parent-bol typescript-ts-mode-indent-offset) ,@(when (eq language 'tsx) `(((parent-is "jsx_opening_element") parent typescript-ts-mode-indent-offset) + ((match "<" "jsx_fragment") parent 0) + ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset) ((node-is "jsx_closing_element") parent 0) ((parent-is "jsx_element") parent typescript-ts-mode-indent-offset) ((node-is "/") parent 0) -- 2.34.1 --=-=-=-- ------------=_1671057662-6266-1--