Subject: 29.1; [PATCH] rust-ts-mode: Add electric indentation chars
From: Christophe TROESTLER <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Thu, 7 Dec 2023 22:16:19 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This is a patch against the emacs-29 branch to add more chars to the electric indentation for rust-ts-mode.

Best,
Christophe

From fd261c2157b2c85c9e1f902bb81d84f9cde78ea9 Mon Sep 17 00:00:00 2001
From: Christophe Troestler <[email-masked]>
Date: Thu, 7 Dec 2023 23:03:07 +0100
Subject: [PATCH] rust-ts-mode: Add electric indentation chars
Content-Type: text/plain; charset="utf-8"

---
 lisp/progmodes/rust-ts-mode.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 8127aa956f4..cc803f5f91a 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -435,6 +435,10 @@ rust-ts-mode
     (setq-local indent-tabs-mode nil
                 treesit-simple-indent-rules rust-ts-mode--indent-rules)
 
+    ;; Electric
+    (setq-local electric-indent-chars
+                (append "{}():;,#" electric-indent-chars))
+
     ;; Navigation.
     (setq-local treesit-defun-type-regexp
                 (regexp-opt '("enum_item"
-- 
2.42.0