From: Yuan Fu Date: Mon, 13 Jan 2025 06:23:36 +0000 (-0800) Subject: Fix c-ts-mode indentation (bug#75442) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1c1641fa32ceeaa24af5b7e27bbb815fbd14f582;p=emacs.git Fix c-ts-mode indentation (bug#75442) * lisp/progmodes/c-ts-mode.el (c-ts-mode--simple-indent-rules): Use standalone-parent instead of parent. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test. (cherry picked from commit 04032cd00af7617c709140f3c80b5604b05c11e8) --- diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index f4f6bef2775..99e624412b2 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -474,7 +474,7 @@ MODE can be `c' or `cpp'. STYLE can be `gnu', `k&r', `linux', `bsd'." "enum_specifier" "function_declarator" "template_declaration"))) - parent 0) + standalone-parent 0) ;; This is for the trailing-star stype: int * ;; func() ((match "function_declarator" nil "declarator") parent-bol 0) diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 691f5b6ecfd..3d875e3113e 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -149,6 +149,16 @@ fn() }; =-=-= +Name: typedef with struct definition (bug#75442) + +=-= +typedef struct Point +{ + int x; + int y; +} Point; +=-=-= + Name: Multiline Parameter List (bug#60398) =-=