From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#63879: 29.0.90; [PATCH] Fix rust-ts-mode indentation for else-if Date: Sat, 3 Jun 2023 16:18:47 -0700 Message-ID: <21517EA2-5B9E-4F48-AA23-8D3EAC543F0A@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_DD01BB36-FF9A-4052-8426-0CEBC770CF6C" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25545"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dev@rjt.dev To: 63879@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 01:20:16 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5aXf-0006SA-Uh for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 01:20:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5aXV-0002D8-8m; Sat, 03 Jun 2023 19:20:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5aXT-0002Cp-OO for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 19:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5aXT-000885-Fr for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 19:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5aXS-00014N-La; Sat, 03 Jun 2023 19:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: dev@rjt.dev, bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jun 2023 23:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63879 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Bug Report Emacs X-Debbugs-Original-Xcc: dev@rjt.dev Original-Received: via spool by submit@debbugs.gnu.org id=B.16858343494030 (code B ref -1); Sat, 03 Jun 2023 23:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jun 2023 23:19:09 +0000 Original-Received: from localhost ([127.0.0.1]:44484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5aWb-00012w-9W for submit@debbugs.gnu.org; Sat, 03 Jun 2023 19:19:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5aWW-00012j-Kx for submit@debbugs.gnu.org; Sat, 03 Jun 2023 19:19:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5aWW-0001X8-B2 for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 19:19:04 -0400 Original-Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5aWU-0007uR-QZ for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 19:19:04 -0400 Original-Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-51452556acdso1992505a12.2 for ; Sat, 03 Jun 2023 16:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685834340; x=1688426340; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=WhabPY3zyD/g4NBm411HvQdgWKpuk5Fo+17Ct4lhomY=; b=bwCS36trR/+TsePxCn6FQJxIxs8y2ZMUQ+Y2o/dddKkVvvy0uESpsTbXtWktF6W/YV dQE4zBh28FvWfpfAIaJgmhRFwBgcThcL3VfSFdnVSRh+Fv+Bvs3rzDX/THYSlDfv/erH /F7z0DJ2CgLcm3LPtZpO5YYhML8XR+dbr7rptCNMeiC6CW+wsNG8C2JZ5Ad1nR22e1j3 JTp0fVWojUCG6OS8iEuUrAQ/X3CyyxXVGjl36Rs3iQHQ5V6ddWVXvQ5mLK6LZrAiEsNp B4zhNIDVhmlgdPztnj5VKX4dzbKAs3zdzMaLz01LWQHasLcK0yN8eVSQZFBHMGWTwWY1 ES+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685834340; x=1688426340; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WhabPY3zyD/g4NBm411HvQdgWKpuk5Fo+17Ct4lhomY=; b=PjhIcIP0KtOf8FE7jXwMcGB5ELRykkU+XOHcGESukBVmJntRKxBpqNRHud27i5gbrt wNhRevAwPo+lSNcFAUQ8z/uqyKFWTq/XqrSkl5K5eL3y4Pv5D0eQ3pbHqaz39BsLr4DK EjJPWhC9nOXRumrqzNOZW+TgM1DJ7zDWqwlLgjk07kPt5Zz77oztR9ZrEekdqi5bhwyT 0UMyayk8Qjvs63AvLmUABIdIAMoV7j6aMG8K5bsXXsye/FmCYG/53rMqlMHEDP7OT3wx XeOV9J/G4XyYg6+bO8OqJzzzR+Vfq/As1lQlYaLWDiAXFmkbnEK/83urN161cmA5kY73 5tuA== X-Gm-Message-State: AC+VfDxwwulfkJBJmm+ae/Q+B1NZ9GY1wV/czmRj8eDP7uNzDjYKr0Ru gWtw+fhKcL1jQxz+SikQi9NLHE6P6n8= X-Google-Smtp-Source: ACHHUZ5vFcDCTns7vjJOk1220zw+iWSD/uAS/c5G99VBFsmPl0A6vrXKYvjkXM94vfLdfRMwku24zw== X-Received: by 2002:a17:902:a715:b0:1b0:4934:88bc with SMTP id w21-20020a170902a71500b001b0493488bcmr2373504plq.47.1685834339869; Sat, 03 Jun 2023 16:18:59 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id h10-20020a170902748a00b001b050df0a93sm3689875pll.93.2023.06.03.16.18.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jun 2023 16:18:58 -0700 (PDT) X-Mailer: Apple Mail (2.3731.600.7) Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=casouri@gmail.com; helo=mail-pg1-x532.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262884 Archived-At: --Apple-Mail=_DD01BB36-FF9A-4052-8426-0CEBC770CF6C Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-Debbugs-CC: dev@rjt.dev Example: fn main() { if true { () } else if true { () } } Yuan --Apple-Mail=_DD01BB36-FF9A-4052-8426-0CEBC770CF6C Content-Disposition: attachment; filename=rust-ts-mode.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="rust-ts-mode.patch" Content-Transfer-Encoding: quoted-printable =46rom=20d412e7d597d15a94b6725e231f392518138cc550=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Sat,=20= 3=20Jun=202023=2016:13:05=20-0700=0ASubject:=20[PATCH]=20Fix=20= rust-ts-mode=20indentation=20for=20else-if=0A=0AThis=20change=20fixes=20= the=20indentation=20for=20code=20like=20this:=0A=0Afn=20main()=20{=0A=20=20= =20=20if=20true=20{=0A=20=20=20=20=20=20=20=20()=0A=20=20=20=20}=20else=20= if=20true=20{=0A=20=20=20=20=20=20=20=20()=0A=20=20=20=20}=0A}=0A=0A= Before=20this=20change,=20the=20else-if's=20are=20indented=20one=20more=20= level=20than=20it=0Ashould,=20because=20it's=20nested=20in=20the=20if=20= node:=0A=0Afn=20main()=20{=0A=20=20=20=20if=20true=20{=0A=20=20=20=20=20=20= =20=20()=0A=20=20=20=20}=20else=20if=20true=20{=0A=20=20=20=20=20=20=20=20= =20=20=20=20()=0A=20=20=20=20=20=20=20=20}=0A}=0A=0A*=20= lisp/progmodes/rust-ts-mode.el=20(rust-ts-mode--indent-rules):=20Replace=0A= parent-bol=20with=20standalone-parent.=0A---=0A=20= lisp/progmodes/rust-ts-mode.el=20|=204=20++--=0A=201=20file=20changed,=20= 2=20insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/rust-ts-mode.el=20b/lisp/progmodes/rust-ts-mode.el=0A= index=20be06acde3e3..ca295212640=20100644=0A---=20= a/lisp/progmodes/rust-ts-mode.el=0A+++=20= b/lisp/progmodes/rust-ts-mode.el=0A@@=20-74,7=20+74,7=20@@=20= rust-ts-mode--indent-rules=0A=20=20=20=20=20=20((parent-is=20= "source_file")=20column-0=200)=0A=20=20=20=20=20=20((node-is=20")")=20= parent-bol=200)=0A=20=20=20=20=20=20((node-is=20"]")=20parent-bol=200)=0A= -=20=20=20=20=20((node-is=20"}")=20(and=20parent=20parent-bol)=200)=0A+=20= =20=20=20=20((node-is=20"}")=20(and=20parent=20standalone-parent)=200)=0A= =20=20=20=20=20=20((and=20(parent-is=20"comment")=20= c-ts-common-looking-at-star)=0A=20=20=20=20=20=20=20= c-ts-common-comment-start-after-first-star=20-1)=0A=20=20=20=20=20=20= ((parent-is=20"comment")=20prev-adaptive-prefix=200)=0A@@=20-82,7=20= +82,7=20@@=20rust-ts-mode--indent-rules=0A=20=20=20=20=20=20((parent-is=20= "await_expression")=20parent-bol=20rust-ts-mode-indent-offset)=0A=20=20=20= =20=20=20((parent-is=20"array_expression")=20parent-bol=20= rust-ts-mode-indent-offset)=0A=20=20=20=20=20=20((parent-is=20= "binary_expression")=20parent-bol=20rust-ts-mode-indent-offset)=0A-=20=20= =20=20=20((parent-is=20"block")=20parent-bol=20= rust-ts-mode-indent-offset)=0A+=20=20=20=20=20((parent-is=20"block")=20= standalone-parent=20rust-ts-mode-indent-offset)=0A=20=20=20=20=20=20= ((parent-is=20"declaration_list")=20parent-bol=20= rust-ts-mode-indent-offset)=0A=20=20=20=20=20=20((parent-is=20= "enum_variant_list")=20parent-bol=20rust-ts-mode-indent-offset)=0A=20=20=20= =20=20=20((parent-is=20"field_declaration_list")=20parent-bol=20= rust-ts-mode-indent-offset)=0A--=20=0A2.33.1=0A=0A= --Apple-Mail=_DD01BB36-FF9A-4052-8426-0CEBC770CF6C--