GNU bug report logs -
#67357
[PATCH] Fix c-ts-mode block indent when first-siblings are comments
Previous Next
Reported by: Noah Peart <noah.v.peart <at> gmail.com>
Date: Wed, 22 Nov 2023 01:52:02 UTC
Severity: normal
Tags: patch
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Ping! Ping! Yuan, please chime is, as I'm waiting for your comments
before we install on the release branch.
This and other patches for TS-based modes are currently delaying the
release of Emacs 29.2, so please try to be more responsive, okay?
> Cc: noah.v.peart <at> gmail.com, 67357 <at> debbugs.gnu.org, dmitry <at> gutov.dev
> Date: Wed, 29 Nov 2023 15:47:25 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > Date: Fri, 24 Nov 2023 16:46:32 +0200
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Cc: dmitry <at> gutov.dev, casouri <at> gmail.com, 67357 <at> debbugs.gnu.org
> >
> > > From: Noah Peart <noah.v.peart <at> gmail.com>
> > > Date: Fri, 24 Nov 2023 06:35:06 -0800
> > > Cc: dmitry <at> gutov.dev, casouri <at> gmail.com, 67357 <at> debbugs.gnu.org
> > >
> > > To reproduce the indentation bugs for unbracketed `else_clause`, and
> > > do-while:
> > > 1. open a buffer and insert the following:
> > >
> > > int main() {
> > > if (true)
> > > puts("Hello");
> > > else
> > > puts("No matched rule!"); // 1
> > > do
> > > puts("Hello");
> > > while (indented_as_part_of_block); // 2
> > > }
> > >
> > > 2. call `M-x example-setup` to configure `c-ts-mode`
> > > 3. `M-x indent-region` to indent the whole buffer
> > > You should see that the line with comment `1` has not been
> > > indented, and the line with comment `2` has been indented to the
> > > same level as the previous line.
> > >
> > > To reproduce the indentation bugs when comments are the first
> > > siblings:
> > > 1. open a buffer and insert:
> > >
> > > int main() {
> > > while (true) { /* foo */
> > > if (true) { // 1
> > > puts ("Hello"); // 2
> > > }
> > > }
> > > }
> > >
> > > 2. call `M-x example-setup` to configure `c-ts-mode`
> > > 3. `M-x indent-region` to indent the whole buffer
> > >
> > > You should see that the lines with comments `1` and `2` have
> > > not been indented at all.
> >
> > Thanks, I see the problems now.
> >
> > Let's wait for Yuan to chime in.
>
> Yuan, could you please comment on the proposed solution? TIA.
>
>
>
>
This bug report was last modified 1 year and 196 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.