unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
@ 2022-12-23  9:30 Mohammed Sadiq
  2022-12-24  8:33 ` Yuan Fu
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2022-12-23  9:30 UTC (permalink / raw)
  To: 60270

In c-ts-mode, comments are indented wrong. Say for example, if a C
source file contains the following content:

/**
* @some_func:
* @arg1:
*/


and if I select all and indent with C-x h TAB, I get the following:

/**
* @some_func:
* @arg1:
   */

But I expect to get the following:

/**
  * @some_func:
  * @arg1:
  */



In GNU Emacs 29.0.60 (build 9, x86_64-pc-linux-gnu, GTK+ Version
  3.24.35, cairo version 1.16.0) of 2022-12-23 built on purism
Repository revision: 5a34e7c86ca1bfd5bc6ae362ae25c02d21ec0315
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 
11.0.12101004
System Description: Debian GNU/Linux bookworm/sid

Configured using:
  'configure --prefix=/usr'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
   value of $LANG: en_IN.UTF-8
   value of $XMODIFIERS: @im=ibus
   locale-coding-system: utf-8-unix

Major mode: C

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
cl-extra help-mode c-ts-mode treesit cl-seq cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
emacs)

Memory information:
((conses 16 61243 10622)
  (symbols 48 7256 0)
  (strings 32 20401 1361)
  (string-bytes 1 738706)
  (vectors 16 13101)
  (vector-slots 8 185051 13241)
  (floats 8 28 214)
  (intervals 56 274 0)
  (buffers 984 11))





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
@ 2022-12-24  8:33 ` Yuan Fu
  2022-12-24  9:49   ` Mohammed Sadiq
  2022-12-24 22:32 ` Yuan Fu
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Yuan Fu @ 2022-12-24  8:33 UTC (permalink / raw)
  To: sadiq; +Cc: 60270


Mohammed Sadiq <sadiq@sadiqpk.org> writes:

> In c-ts-mode, comments are indented wrong. Say for example, if a C
> source file contains the following content:
>
> /**
> * @some_func:
> * @arg1:
> */
>
>
> and if I select all and indent with C-x h TAB, I get the following:
>
> /**
> * @some_func:
> * @arg1:
>   */
>
> But I expect to get the following:
>
> /**
>  * @some_func:
>  * @arg1:
>  */

Should be fixed now, please give it a try :-)

Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2022-12-24  8:33 ` Yuan Fu
@ 2022-12-24  9:49   ` Mohammed Sadiq
  0 siblings, 0 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2022-12-24  9:49 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 60270

On 2022-12-24 14:03, Yuan Fu wrote:
> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> 
>> In c-ts-mode, comments are indented wrong. Say for example, if a C
>> source file contains the following content:
>> 
>> /**
>> * @some_func:
>> * @arg1:
>> */
>> 
>> 
>> and if I select all and indent with C-x h TAB, I get the following:
>> 
>> /**
>> * @some_func:
>> * @arg1:
>>   */
>> 
>> But I expect to get the following:
>> 
>> /**
>>  * @some_func:
>>  * @arg1:
>>  */
> 
> Should be fixed now, please give it a try :-)
> 
> Yuan


Yes, it does work now, thanks.

Can this be more in par with c-mode.  Not strictly required, but would
be nice to have if someone used to use c-mode and migrated to c-ts-mode
and indented the code with select all and TAB (to avoid unnecessary 
change).

The test cases are:

/*
   some comment
*/

/*
  * Some comment
  */


cheers,
Mohammed Sadiq





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
  2022-12-24  8:33 ` Yuan Fu
@ 2022-12-24 22:32 ` Yuan Fu
  2022-12-25  4:34   ` Mohammed Sadiq
  2022-12-25  8:36 ` Yuan Fu
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Yuan Fu @ 2022-12-24 22:32 UTC (permalink / raw)
  To: sadiq; +Cc: 60270


Mohammed Sadiq <sadiq@sadiqpk.org> writes:

> On 2022-12-24 14:03, Yuan Fu wrote:
>> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
>> 
>>> In c-ts-mode, comments are indented wrong. Say for example, if a C
>>> source file contains the following content:
>>> /**
>>> * @some_func:
>>> * @arg1:
>>> */
>>> and if I select all and indent with C-x h TAB, I get the following:
>>> /**
>>> * @some_func:
>>> * @arg1:
>>>   */
>>> But I expect to get the following:
>>> /**
>>>  * @some_func:
>>>  * @arg1:
>>>  */
>> Should be fixed now, please give it a try :-)
>> Yuan
>
>
> Yes, it does work now, thanks.
>
> Can this be more in par with c-mode.  Not strictly required, but would
> be nice to have if someone used to use c-mode and migrated to c-ts-mode
> and indented the code with select all and TAB (to avoid unnecessary
> change).
>
> The test cases are:
>
> /*
>   some comment
> */
>
> /*
>  * Some comment
>  */

I didn’t quite get it, what’s the expected behavior you are looking for?
The two example indents like the following right now:

/*
  some comment
*/


/*
* Some comment
*/


Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2022-12-24 22:32 ` Yuan Fu
@ 2022-12-25  4:34   ` Mohammed Sadiq
  0 siblings, 0 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2022-12-25  4:34 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 60270

On 2022-12-25 04:02, Yuan Fu wrote:
> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> 
>> On 2022-12-24 14:03, Yuan Fu wrote:
>>> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
>>> 
>>>> In c-ts-mode, comments are indented wrong. Say for example, if a C
>>>> source file contains the following content:
>>>> /**
>>>> * @some_func:
>>>> * @arg1:
>>>> */
>>>> and if I select all and indent with C-x h TAB, I get the following:
>>>> /**
>>>> * @some_func:
>>>> * @arg1:
>>>>   */
>>>> But I expect to get the following:
>>>> /**
>>>>  * @some_func:
>>>>  * @arg1:
>>>>  */
>>> Should be fixed now, please give it a try :-)
>>> Yuan
>> 
>> 
>> Yes, it does work now, thanks.
>> 
>> Can this be more in par with c-mode.  Not strictly required, but would
>> be nice to have if someone used to use c-mode and migrated to 
>> c-ts-mode
>> and indented the code with select all and TAB (to avoid unnecessary
>> change).
>> 
>> The test cases are:
>> 
>> /*
>>   some comment
>> */
>> 
>> /*
>>  * Some comment
>>  */
> 
> I didn’t quite get it, what’s the expected behavior you are looking 
> for?
> The two example indents like the following right now:
> 
> /*
>   some comment
> */
> 
> 
> /*
> * Some comment
> */
> 
> 
> Yuan

On buffer select-all TAB, for the following comment:

/*
   hello
*/

I get the following in c-mode (no space before */):

/*
   hello
*/

and the following in c-ts-mode (a space before */):

/*
   hello
  */





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
  2022-12-24  8:33 ` Yuan Fu
  2022-12-24 22:32 ` Yuan Fu
@ 2022-12-25  8:36 ` Yuan Fu
  2022-12-25  9:25   ` Eli Zaretskii
  2022-12-25  9:46   ` Mohammed Sadiq
  2023-01-07 23:28 ` Yuan Fu
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 20+ messages in thread
From: Yuan Fu @ 2022-12-25  8:36 UTC (permalink / raw)
  To: sadiq; +Cc: Alan Mackenzie, 60270


> On buffer select-all TAB, for the following comment:
>
> /*
>   hello
> */
>
> I get the following in c-mode (no space before */):
>
> /*
>   hello
> */
>
> and the following in c-ts-mode (a space before */):
>
> /*
>   hello
>  */

I have to say I’m not a C veteran, but I feel like the c-ts-mode result
makes more sense. Why do we want

/*
  * hello
  */

but not

/*
  hello
  */

?

Is it like a convention?

CC’ed Alan because he must know this.

Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-25  8:36 ` Yuan Fu
@ 2022-12-25  9:25   ` Eli Zaretskii
  2023-01-03 14:30     ` Mohammed Sadiq
  2022-12-25  9:46   ` Mohammed Sadiq
  1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-12-25  9:25 UTC (permalink / raw)
  To: Yuan Fu; +Cc: acm, sadiq, 60270

> Cc: Alan Mackenzie <acm@muc.de>, 60270@debbugs.gnu.org
> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 25 Dec 2022 00:36:46 -0800
> 
> 
> I have to say I’m not a C veteran, but I feel like the c-ts-mode result
> makes more sense. Why do we want
> 
> /*
>   * hello
>   */
> 
> but not
> 
> /*
>   hello
>   */
> 
> ?

We actually want this:

  /*
   * hello
   */





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2022-12-25  8:36 ` Yuan Fu
  2022-12-25  9:25   ` Eli Zaretskii
@ 2022-12-25  9:46   ` Mohammed Sadiq
  1 sibling, 0 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2022-12-25  9:46 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Alan Mackenzie, 60270

On 2022-12-25 14:06, Yuan Fu wrote:
>> On buffer select-all TAB, for the following comment:
>> 
>> /*
>>   hello
>> */
>> 
>> I get the following in c-mode (no space before */):
>> 
>> /*
>>   hello
>> */
>> 
>> and the following in c-ts-mode (a space before */):
>> 
>> /*
>>   hello
>>  */
> 
> I have to say I’m not a C veteran, but I feel like the c-ts-mode result
> makes more sense. Why do we want
> 
> /*
>   * hello
>   */
> 
> but not
> 
> /*
>   hello
>   */
> 
> ?
> 
> Is it like a convention?

I don't know, I was suggesting to have c-ts-mode behave like c-mode.
So, as to avoid unnecessary changes (as it adds unnecessary noise in
version control history, for those who are using one) on buffer
select-all TAB indent and for the people who migrated to c-ts-mode.

> 
> CC’ed Alan because he must know this.
> 
> Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-25  9:25   ` Eli Zaretskii
@ 2023-01-03 14:30     ` Mohammed Sadiq
  0 siblings, 0 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2023-01-03 14:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: acm, Yuan Fu, 60270

Now it indents properly when selecting the comment and TAB,
but if point is inside the comment, the line indents further
breaking the indentation.

example, for the following code:

/*
  * Some comment
  */

and I place the point to be between '*' and '/' in the comment
and or somewhere in the "Some comment" string, and then press
TAB, the line indents further, breaking the indentation.





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
                   ` (2 preceding siblings ...)
  2022-12-25  8:36 ` Yuan Fu
@ 2023-01-07 23:28 ` Yuan Fu
  2023-01-08 10:02   ` Mohammed Sadiq
  2023-01-10  5:28 ` Yuan Fu
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Yuan Fu @ 2023-01-07 23:28 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: Alan Mackenzie, Eli Zaretskii, 60270


Mohammed Sadiq <sadiq@sadiqpk.org> writes:

> Now it indents properly when selecting the comment and TAB,
> but if point is inside the comment, the line indents further
> breaking the indentation.
>
> example, for the following code:
>
> /*
>  * Some comment
>  */
>
> and I place the point to be between '*' and '/' in the comment
> and or somewhere in the "Some comment" string, and then press
> TAB, the line indents further, breaking the indentation.

Ah, yes. I fixed that. Thanks for the report.

Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-07 23:28 ` Yuan Fu
@ 2023-01-08 10:02   ` Mohammed Sadiq
  0 siblings, 0 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2023-01-08 10:02 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Alan Mackenzie, Eli Zaretskii, 60270

On 2023-01-08 04:58, Yuan Fu wrote:
> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> 
>> Now it indents properly when selecting the comment and TAB,
>> but if point is inside the comment, the line indents further
>> breaking the indentation.
>> 
>> example, for the following code:
>> 
>> /*
>>  * Some comment
>>  */
>> 
>> and I place the point to be between '*' and '/' in the comment
>> and or somewhere in the "Some comment" string, and then press
>> TAB, the line indents further, breaking the indentation.
> 
> Ah, yes. I fixed that. Thanks for the report.
> 
> Yuan

There is one more case that's broken:

int
main (void)
{
   /*
Some comment
    */
}


Where I expect it to be:

int
main (void)
{
   /*
      Some comment
   */
}






^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
                   ` (3 preceding siblings ...)
  2023-01-07 23:28 ` Yuan Fu
@ 2023-01-10  5:28 ` Yuan Fu
  2023-01-10 10:13   ` Mohammed Sadiq
  2023-01-14  7:53 ` Yuan Fu
  2023-01-16  8:24 ` Yuan Fu
  6 siblings, 1 reply; 20+ messages in thread
From: Yuan Fu @ 2023-01-10  5:28 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: 60270


Mohammed Sadiq <sadiq@sadiqpk.org> writes:

> On 2023-01-08 04:58, Yuan Fu wrote:
>> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
>> 
>>> Now it indents properly when selecting the comment and TAB,
>>> but if point is inside the comment, the line indents further
>>> breaking the indentation.
>>> example, for the following code:
>>> /*
>>>  * Some comment
>>>  */
>>> and I place the point to be between '*' and '/' in the comment
>>> and or somewhere in the "Some comment" string, and then press
>>> TAB, the line indents further, breaking the indentation.
>> Ah, yes. I fixed that. Thanks for the report.
>> Yuan
>
> There is one more case that's broken:
>
> int
> main (void)
> {
>   /*
> Some comment
>    */
> }
>
>
> Where I expect it to be:
>
> int
> main (void)
> {
>   /*
>      Some comment
>   */
> }

Ah, right. Now it’s fixed. Thanks!

Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-10  5:28 ` Yuan Fu
@ 2023-01-10 10:13   ` Mohammed Sadiq
  2023-01-10 12:17     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-11  9:30     ` Yuan Fu
  0 siblings, 2 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2023-01-10 10:13 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 60270

On 2023-01-10 10:58, Yuan Fu wrote:
> 
> Ah, right. Now it’s fixed. Thanks!
> 
> Yuan

This broke the following comment styles:

/* some comment
*/

indentation of above code gives:

/* some comment
    */


Also:

/*
    * some comment
  */

where I expect:

/*
  * some comment
  */


If there are ways to add automated tests, it would be nice so that
these won't be broken when fixing something else.


cheers,
Mohammed Sadiq





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-10 10:13   ` Mohammed Sadiq
@ 2023-01-10 12:17     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-01-11  9:27       ` Yuan Fu
  2023-01-11  9:30     ` Yuan Fu
  1 sibling, 1 reply; 20+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-10 12:17 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: Yuan Fu, 60270

Mohammed Sadiq <sadiq@sadiqpk.org> writes:

>
> If there are ways to add automated tests, it would be nice so that
> these won't be broken when fixing something else.
>

I sent a patch to emacs-devel a few days ago with some basic regression
testing infrastructure for Tree-sitter modes:
https://lists.gnu.org/archive/html/emacs-devel/2023-01/msg00111.html
Yuan, WDYT?





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-10 12:17     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-01-11  9:27       ` Yuan Fu
  0 siblings, 0 replies; 20+ messages in thread
From: Yuan Fu @ 2023-01-11  9:27 UTC (permalink / raw)
  To: Daniel Martín; +Cc: Mohammed Sadiq, 60270



> On Jan 10, 2023, at 4:17 AM, Daniel Martín <mardani29@yahoo.es> wrote:
> 
> Mohammed Sadiq <sadiq@sadiqpk.org> writes:
> 
>> 
>> If there are ways to add automated tests, it would be nice so that
>> these won't be broken when fixing something else.
>> 
> 
> I sent a patch to emacs-devel a few days ago with some basic regression
> testing infrastructure for Tree-sitter modes:
> https://lists.gnu.org/archive/html/emacs-devel/2023-01/msg00111.html
> Yuan, WDYT?

I think it’s very nice. I can apply that patch and add some indent tests that I have locally.

Yuan




^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-10 10:13   ` Mohammed Sadiq
  2023-01-10 12:17     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-01-11  9:30     ` Yuan Fu
  2023-01-13  8:58       ` Yuan Fu
  1 sibling, 1 reply; 20+ messages in thread
From: Yuan Fu @ 2023-01-11  9:30 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: 60270



> On Jan 10, 2023, at 2:13 AM, Mohammed Sadiq <sadiq@sadiqpk.org> wrote:
> 
> On 2023-01-10 10:58, Yuan Fu wrote:
>> Ah, right. Now it’s fixed. Thanks!
>> Yuan
> 
> This broke the following comment styles:
> 
> /* some comment
> */
> 
> indentation of above code gives:
> 
> /* some comment
>   */
> 
> 
> Also:
> 
> /*
>   * some comment
> */
> 
> where I expect:
> 
> /*
> * some comment
> */

This is easy to fix, I’ll push a fix soon.

> 
> If there are ways to add automated tests, it would be nice so that
> these won't be broken when fixing something else.

I agree. I have been busy fixing all sorts of bugs and haven’t go around to it :-(

Yuan




^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-11  9:30     ` Yuan Fu
@ 2023-01-13  8:58       ` Yuan Fu
  0 siblings, 0 replies; 20+ messages in thread
From: Yuan Fu @ 2023-01-13  8:58 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: 60270



> On Jan 11, 2023, at 1:30 AM, Yuan Fu <casouri@gmail.com> wrote:
> 
> 
> 
>> On Jan 10, 2023, at 2:13 AM, Mohammed Sadiq <sadiq@sadiqpk.org> wrote:
>> 
>> On 2023-01-10 10:58, Yuan Fu wrote:
>>> Ah, right. Now it’s fixed. Thanks!
>>> Yuan
>> 
>> This broke the following comment styles:
>> 
>> /* some comment
>> */
>> 
>> indentation of above code gives:
>> 
>> /* some comment
>>  */
>> 
>> 
>> Also:
>> 
>> /*
>>  * some comment
>> */
>> 
>> where I expect:
>> 
>> /*
>> * some comment
>> */
> 
> This is easy to fix, I’ll push a fix soon.

I pushed the fix.

> 
>> 
>> If there are ways to add automated tests, it would be nice so that
>> these won't be broken when fixing something else.
> 
> I agree. I have been busy fixing all sorts of bugs and haven’t go around to it :-(

I added the c-ts-mode tests you had in the patch.

Yuan




^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
                   ` (4 preceding siblings ...)
  2023-01-10  5:28 ` Yuan Fu
@ 2023-01-14  7:53 ` Yuan Fu
  2023-01-15  5:28   ` Mohammed Sadiq
  2023-01-16  8:24 ` Yuan Fu
  6 siblings, 1 reply; 20+ messages in thread
From: Yuan Fu @ 2023-01-14  7:53 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: 60270-done


Yuan Fu <casouri@gmail.com> writes:

>> On Jan 11, 2023, at 1:30 AM, Yuan Fu <casouri@gmail.com> wrote:
>> 
>> 
>> 
>>> On Jan 10, 2023, at 2:13 AM, Mohammed Sadiq <sadiq@sadiqpk.org> wrote:
>>> 
>>> On 2023-01-10 10:58, Yuan Fu wrote:
>>>> Ah, right. Now it’s fixed. Thanks!
>>>> Yuan
>>> 
>>> This broke the following comment styles:
>>> 
>>> /* some comment
>>> */
>>> 
>>> indentation of above code gives:
>>> 
>>> /* some comment
>>>  */
>>> 
>>> 
>>> Also:
>>> 
>>> /*
>>>  * some comment
>>> */
>>> 
>>> where I expect:
>>> 
>>> /*
>>> * some comment
>>> */
>> 
>> This is easy to fix, I’ll push a fix soon.
>
> I pushed the fix.
>
>> 
>>> 
>>> If there are ways to add automated tests, it would be nice so that
>>> these won't be broken when fixing something else.
>> 
>> I agree. I have been busy fixing all sorts of bugs and haven’t go around to it :-(
>
> I added the c-ts-mode tests you had in the patch.

I added some more indent and filling tests. Now I think this can be
closed, yay!

Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation
  2023-01-14  7:53 ` Yuan Fu
@ 2023-01-15  5:28   ` Mohammed Sadiq
  0 siblings, 0 replies; 20+ messages in thread
From: Mohammed Sadiq @ 2023-01-15  5:28 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 60270-done

On 2023-01-14 13:23, Yuan Fu wrote:
> I added some more indent and filling tests. Now I think this can be
> closed, yay!


Thanks, Looks like almost all issues has been fixed.  I found one more
case that this fails:

int
main (void)
{
/*
line one
line 2
*/
}

In the above code, if I select the whole buffer and indent, line 2 
doesn't
indent





^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#60270: 29.0.60; c-ts-mode: Comments are not indented right  on auto indentation
  2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
                   ` (5 preceding siblings ...)
  2023-01-14  7:53 ` Yuan Fu
@ 2023-01-16  8:24 ` Yuan Fu
  6 siblings, 0 replies; 20+ messages in thread
From: Yuan Fu @ 2023-01-16  8:24 UTC (permalink / raw)
  To: Mohammed Sadiq; +Cc: 60270-done, 60270


Mohammed Sadiq <sadiq@sadiqpk.org> writes:

> On 2023-01-14 13:23, Yuan Fu wrote:
>> I added some more indent and filling tests. Now I think this can be
>> closed, yay!
>
>
> Thanks, Looks like almost all issues has been fixed.  I found one more
> case that this fails:
>
> int
> main (void)
> {
> /*
> line one
> line 2
> */
> }
>
> In the above code, if I select the whole buffer and indent, line 2
> doesn't
> indent

Ok, that’s not due to incorrect due to incorrect indentation rule, but
rather the indentation function. Anyway, I fixed it and added a test.
Thanks!

Yuan





^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-01-16  8:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-23  9:30 bug#60270: 29.0.60; c-ts-mode: Comments are not indented right on auto indentation Mohammed Sadiq
2022-12-24  8:33 ` Yuan Fu
2022-12-24  9:49   ` Mohammed Sadiq
2022-12-24 22:32 ` Yuan Fu
2022-12-25  4:34   ` Mohammed Sadiq
2022-12-25  8:36 ` Yuan Fu
2022-12-25  9:25   ` Eli Zaretskii
2023-01-03 14:30     ` Mohammed Sadiq
2022-12-25  9:46   ` Mohammed Sadiq
2023-01-07 23:28 ` Yuan Fu
2023-01-08 10:02   ` Mohammed Sadiq
2023-01-10  5:28 ` Yuan Fu
2023-01-10 10:13   ` Mohammed Sadiq
2023-01-10 12:17     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-11  9:27       ` Yuan Fu
2023-01-11  9:30     ` Yuan Fu
2023-01-13  8:58       ` Yuan Fu
2023-01-14  7:53 ` Yuan Fu
2023-01-15  5:28   ` Mohammed Sadiq
2023-01-16  8:24 ` Yuan Fu

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).