all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: Mohammed Sadiq <sadiq@sadiqpk.org>, 60572@debbugs.gnu.org
Subject: bug#60572: 29.0.60; c-ts-mode: String spanning multiple lines are not indented
Date: Sat, 07 Jan 2023 13:07:05 +0100	[thread overview]
Message-ID: <87lemetuom.fsf_-_@thornhill.no> (raw)
In-Reply-To: <0027AF78-0A38-4F41-848E-D620D8E4F8DF@gmail.com> (Yuan Fu's message of "Thu, 5 Jan 2023 22:51:16 -0700")

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

Yuan Fu <casouri@gmail.com> writes:

> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
>
>> The following code doesn't indent with TAB on c-ts-mode:
>>
>> #include <stdio.h>
>>
>> int
>> main (void)
>> {
>>   char *test = "some "
>>   "test";
>>
>>   puts ("more "
>>   "test");
>> }
>>
>>
>> expected indentation:
>>
>> #include <stdio.h>
>>
>> int
>> main (void)
>> {
>>   char *test = "some "
>>     "test";
>>
>>   puts ("more "
>> 	"test");
>> }
>>
>
> Thanks for the report. I’m on the road right now, but I’ll soon get back
> and work on this and your other reports, just FYI :-)
>
> Yuan

Here is a patch fixing this, Yuan.  Feel free to install at your
convenience.

Do you agree with this patch, Mohammed?

Theo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-indentation-rule-for-concatenated_string-bug-605.patch --]
[-- Type: text/x-patch, Size: 1118 bytes --]

From 0891cff08c2e6438902ed09291d5e52e742bab11 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
Date: Sat, 7 Jan 2023 13:04:07 +0100
Subject: [PATCH] Add indentation rule for concatenated_string (bug#60572)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Indent to
parent-bol.
---
 lisp/progmodes/c-ts-mode.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index e76966e7660..a22f1f3c44f 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -138,6 +138,7 @@ c-ts-mode--indent-styles
            ((parent-is "function_definition") 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") parent-bol c-ts-mode-indent-offset)
            ((parent-is "comma_expression") first-sibling 0)
            ((parent-is "init_declarator") parent-bol c-ts-mode-indent-offset)
            ((parent-is "parenthesized_expression") first-sibling 1)
-- 
2.34.1


  reply	other threads:[~2023-01-07 12:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 11:12 bug#60572: 29.0.60; c-ts-mode: String spanning multiple lines are not indented Mohammed Sadiq
2023-01-06  5:51 ` Yuan Fu
2023-01-07 12:07   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-01-21  8:10     ` Mohammed Sadiq
2023-01-08  2:21 ` Yuan Fu
2023-01-08  8:12   ` Mohammed Sadiq
2023-01-08  9:18     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-08  9:45       ` Mohammed Sadiq

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lemetuom.fsf_-_@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60572@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=sadiq@sadiqpk.org \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.