bug#81588: 32.0.50; c-ts-mode is indenting concatenated string literals

Sean Whitton <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Tomas Nordin [09/Aug 11:38am GMT] wrote:
> To reproduce this problem, write a c-file with something like the
> following code making sure c-ts-mode is NOT enabled, using emacs -Q:
>
> char *lines =
>   "line1\n"
>   "line2\n";
>
> Observe how hitting TAB on respective line is not changing the
> indentation.
>
> Now turn on c-ts-mode and observe how hitting TAB will change the
> indentation to this.
>
> char *lines =
>   "line1\n"
>     "line2\n"
>
> I would typically expect the c-mode behavior.
>
> In bug#68493 I mentioned a diff that fixes this problem for me. I
> thought I should present it here in its own bug report to be rejected
> or accepted or something else. I attach the diff.
>
> In GNU Emacs 32.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.49, cairo version 1.18.4) of 2026-08-09 built on fliptop2
> Repository revision: b157d8e96a26e7509136bf93fad2c7ec49c0ee88
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
> System Description: Debian GNU/Linux 13 (trixie)
>
> diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
> index 5f064716a89..fa09cb21b34 100644
> --- a/lisp/progmodes/c-ts-mode.el
> +++ b/lisp/progmodes/c-ts-mode.el
> @@ -503,7 +503,8 @@ c-ts-mode--simple-indent-rules
>                                  "enum_specifier"
>                                  "union_specifier"
>                                  "function_declarator"
> -                                "template_declaration")))
> +                                "template_declaration"
> +                                "concatenated_string")))
>              standalone-parent 0)
>             ;; This is for the trailing-star stype:  int *
>             ;;                                       func()

Yuan, what do you think?

-- 
Sean Whitton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.