From: Yuan Fu Date: Sat, 23 Dec 2023 05:25:00 +0000 (-0800) Subject: Fix c++-ts-mode indentation (bug#67975) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0fde0fe21d8bae711e563a42e2f1f0ecaf19dd86;p=emacs.git Fix c++-ts-mode indentation (bug#67975) * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Make indent rule match precise so it doesn't match declaration_list. (cherry picked from commit d220893216c3c6873b2bb529628e08c526d7f4ff) --- diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 94c1d9ac654..9c698161a81 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -438,7 +438,7 @@ MODE is either `c' or `cpp'." ((parent-is "function_definition") parent-bol 0) ((parent-is "pointer_declarator") parent-bol 0) - ((parent-is "declaration") parent-bol 0) + ((parent-is ,(rx bos "declaration" eos)) parent-bol 0) ((parent-is "conditional_expression") first-sibling 0) ((parent-is "assignment_expression") parent-bol c-ts-mode-indent-offset) ((parent-is "concatenated_string") first-sibling 0)