* bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented
@ 2023-01-04 7:28 Mohammed Sadiq
2023-01-06 6:09 ` Yuan Fu
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Mohammed Sadiq @ 2023-01-04 7:28 UTC (permalink / raw)
To: 60543
With the default "gnu" style, labels are not properly indented.
Eg., for the following code:
int
main (void)
{
end:
clean ();
}
I expect to get the following indentation for "end:" (single space
before "end" for "gnu" style, and no indentation for "linux" style):
int
main (void)
{
end:
clean ();
}
In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version
3.24.35, cairo version 1.16.0) of 2023-01-02 built on purism
Repository revision: 2569ede9c496bb060e0b88428cb541088aaba1f9
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version
11.0.12101005
System Description: Debian GNU/Linux bookworm/sid
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented
2023-01-04 7:28 bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented Mohammed Sadiq
@ 2023-01-06 6:09 ` Yuan Fu
2023-01-08 2:15 ` Yuan Fu
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Yuan Fu @ 2023-01-06 6:09 UTC (permalink / raw)
To: Mohammed Sadiq; +Cc: 60543
Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> With the default "gnu" style, labels are not properly indented.
>
> Eg., for the following code:
>
> int
> main (void)
> {
> end:
> clean ();
> }
>
>
> I expect to get the following indentation for "end:" (single space
> before "end" for "gnu" style, and no indentation for "linux" style):
>
> int
> main (void)
> {
> end:
> clean ();
> }
>
Thanks for the report! As I said in another message, I’ll work on them
once I get back home. Stay tuned :-)
Yuan
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented
2023-01-04 7:28 bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented Mohammed Sadiq
2023-01-06 6:09 ` Yuan Fu
@ 2023-01-08 2:15 ` Yuan Fu
2023-01-08 8:36 ` Mohammed Sadiq
2023-01-09 1:06 ` Yuan Fu
[not found] ` <handler.60543.D60543.167322640910612.notifdone@debbugs.gnu.org>
3 siblings, 1 reply; 6+ messages in thread
From: Yuan Fu @ 2023-01-08 2:15 UTC (permalink / raw)
To: Mohammed Sadiq; +Cc: 60543
Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> With the default "gnu" style, labels are not properly indented.
>
> Eg., for the following code:
>
> int
> main (void)
> {
> end:
> clean ();
> }
>
>
> I expect to get the following indentation for "end:" (single space
> before "end" for "gnu" style, and no indentation for "linux" style):
>
> int
> main (void)
> {
> end:
> clean ();
> }
After reading the manual for GNU indent, I think Linux style asks for
indenting labels to column 1, not the GNU style. And c-ts-mode’s current
GNU style indentation agrees with GNU indent.
So I only added a rule to indent labels to column 1 in Linux style. Feel
free to correct me, of course.
Yuan
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented
2023-01-08 2:15 ` Yuan Fu
@ 2023-01-08 8:36 ` Mohammed Sadiq
0 siblings, 0 replies; 6+ messages in thread
From: Mohammed Sadiq @ 2023-01-08 8:36 UTC (permalink / raw)
To: Yuan Fu; +Cc: 60543
On 2023-01-08 07:45, Yuan Fu wrote:
> After reading the manual for GNU indent, I think Linux style asks for
> indenting labels to column 1, not the GNU style. And c-ts-mode’s
> current
> GNU style indentation agrees with GNU indent.
>
> So I only added a rule to indent labels to column 1 in Linux style.
> Feel
> free to correct me, of course.
>
> Yuan
As per
https://www.kernel.org/doc/html/v6.0/process/coding-style.html#centralized-exiting-of-functions
the label has no indent from the parent block
And for GNU style, I couldn't find an example the style manual, nor in
GNU hello.
So I except c-ts-mode to have the same behavior as c-mode (even if it's
wrong
as per GNU indent,).
In short, I expect c-ts-mode to behave the same as c-mode because that's
what
users often expect (ie, for those who uses GNU indent, their code will
indent
right regardless of how c-mode or c-ts-mode behave. But for the users
who
migrate from c-mode - the anticipated user base of c-ts-mode - expects
it to
be no different from c-mode)
cheers,
Mohammed Sadiq
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented
2023-01-04 7:28 bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented Mohammed Sadiq
2023-01-06 6:09 ` Yuan Fu
2023-01-08 2:15 ` Yuan Fu
@ 2023-01-09 1:06 ` Yuan Fu
[not found] ` <handler.60543.D60543.167322640910612.notifdone@debbugs.gnu.org>
3 siblings, 0 replies; 6+ messages in thread
From: Yuan Fu @ 2023-01-09 1:06 UTC (permalink / raw)
To: Mohammed Sadiq; +Cc: 60543-done
Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> On 2023-01-08 07:45, Yuan Fu wrote:
>> After reading the manual for GNU indent, I think Linux style asks for
>> indenting labels to column 1, not the GNU style. And c-ts-mode’s
>> current
>> GNU style indentation agrees with GNU indent.
>> So I only added a rule to indent labels to column 1 in Linux style.
>> Feel
>> free to correct me, of course.
>> Yuan
>
> As per
> https://www.kernel.org/doc/html/v6.0/process/coding-style.html#centralized-exiting-of-functions
> the label has no indent from the parent block
>
> And for GNU style, I couldn't find an example the style manual, nor in
> GNU hello.
> So I except c-ts-mode to have the same behavior as c-mode (even if
> it's wrong
> as per GNU indent,).
>
> In short, I expect c-ts-mode to behave the same as c-mode because
> that's what
> users often expect (ie, for those who uses GNU indent, their code will
> indent
> right regardless of how c-mode or c-ts-mode behave. But for the users
> who
> migrate from c-mode - the anticipated user base of c-ts-mode - expects
> it to
> be no different from c-mode)
Thanks. You are completely right. Linux style indents to column 0, and
GNU style indents to column 1 in top-level function and base indent
level of the parent in nested blocks (which is ... interesting).
I changed it to indent like that.
Yuan
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#60543: closed (Re: bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented)
[not found] ` <handler.60543.D60543.167322640910612.notifdone@debbugs.gnu.org>
@ 2023-01-09 5:45 ` Mohammed Sadiq
0 siblings, 0 replies; 6+ messages in thread
From: Mohammed Sadiq @ 2023-01-09 5:45 UTC (permalink / raw)
To: 60543
On 2023-01-09 06:37, help-debbugs@gnu.org wrote:
> Your bug report
>
> #60543: 29.0.60; c-ts-mode: Labels are not properly indented
>
> which was filed against the emacs package, has been closed.
This is still not fixed. Was this closed accidentally?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-09 5:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 7:28 bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented Mohammed Sadiq
2023-01-06 6:09 ` Yuan Fu
2023-01-08 2:15 ` Yuan Fu
2023-01-08 8:36 ` Mohammed Sadiq
2023-01-09 1:06 ` Yuan Fu
[not found] ` <handler.60543.D60543.167322640910612.notifdone@debbugs.gnu.org>
2023-01-09 5:45 ` bug#60543: closed (Re: bug#60543: 29.0.60; c-ts-mode: Labels are not properly indented) Mohammed Sadiq
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.