all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#72116: 30.0.60; Filling c-ts-mode documentation is broken
@ 2024-07-14 18:23 Damien Cassou
  2024-07-14 18:44 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Cassou @ 2024-07-14 18:23 UTC (permalink / raw)
  To: 72116

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

Filling documentation in a c-ts-mode buffer doesn't insert the " * "
prefix. It works fine in c-mode. How to reproduce:

1. Install the C treesitter grammar
2. Start emacs with "emacs -Q"
3. Open the attached file in a new buffer
4. Run M-x c-ts-mode
5. Move point to the middle of line 2
6. Press M-q

Expected: 2 lines of documentation, each one starting with " * "

Actual: 2 lines of documentation, only the first one starting
with " * "

If you remove step 4 from the above instructions, c-mode will do the
work just fine.

The solution to this bug could help solve bug#71760.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

[-- Attachment #2: foo.c --]
[-- Type: text/plain, Size: 123 bytes --]

/**
 * rsite nrsoti ernsto ierntires ntoritsen roitsenrsoit enrstoi ensrotie nrsit ensroit enrsoi ensrien
 */
int f() {

}

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

* bug#72116: 30.0.60; Filling c-ts-mode documentation is broken
  2024-07-14 18:23 bug#72116: 30.0.60; Filling c-ts-mode documentation is broken Damien Cassou
@ 2024-07-14 18:44 ` Eli Zaretskii
  2024-07-17  4:18   ` Yuan Fu
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-07-14 18:44 UTC (permalink / raw)
  To: Damien Cassou, Yuan Fu; +Cc: 72116

> From: Damien Cassou <damien@cassou.me>
> Date: Sun, 14 Jul 2024 20:23:09 +0200
> 
> Filling documentation in a c-ts-mode buffer doesn't insert the " * "
> prefix. It works fine in c-mode. How to reproduce:
> 
> 1. Install the C treesitter grammar
> 2. Start emacs with "emacs -Q"
> 3. Open the attached file in a new buffer
> 4. Run M-x c-ts-mode
> 5. Move point to the middle of line 2
> 6. Press M-q

You can work around this by enabling auto-fill-mode.  Then typing SPC
at the end of the long line will produce the effect you want.

Yuan, can you please look into this?

> If you remove step 4 from the above instructions, c-mode will do the
> work just fine.

In c-mode, M-q is bound to a c-mode specific function, which makes no
sens in c-ts-mode.  We need a ts-specific solution (and we already
seem to have it, it just isn't working in this case for some reason).





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

* bug#72116: 30.0.60; Filling c-ts-mode documentation is broken
  2024-07-14 18:44 ` Eli Zaretskii
@ 2024-07-17  4:18   ` Yuan Fu
  0 siblings, 0 replies; 3+ messages in thread
From: Yuan Fu @ 2024-07-17  4:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Damien Cassou, 72116-done



> On Jul 14, 2024, at 11:44 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Damien Cassou <damien@cassou.me>
>> Date: Sun, 14 Jul 2024 20:23:09 +0200
>> 
>> Filling documentation in a c-ts-mode buffer doesn't insert the " * "
>> prefix. It works fine in c-mode. How to reproduce:
>> 
>> 1. Install the C treesitter grammar
>> 2. Start emacs with "emacs -Q"
>> 3. Open the attached file in a new buffer
>> 4. Run M-x c-ts-mode
>> 5. Move point to the middle of line 2
>> 6. Press M-q
> 
> You can work around this by enabling auto-fill-mode.  Then typing SPC
> at the end of the long line will produce the effect you want.
> 
> Yuan, can you please look into this?

Fixed and pushed to master. I didn’t push this to emacs-30 since adaptive-filling is a fragile being, so let’s wait and see :-)

> 
>> If you remove step 4 from the above instructions, c-mode will do the
>> work just fine.
> 
> In c-mode, M-q is bound to a c-mode specific function, which makes no
> sens in c-ts-mode.  We need a ts-specific solution (and we already
> seem to have it, it just isn't working in this case for some reason).

In c-ts-mode, M-q jumps a few hops, but it eventually calls c-ts-mode’s filling function (c-ts-common--fill-paragraph).

Yuan




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

end of thread, other threads:[~2024-07-17  4:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-14 18:23 bug#72116: 30.0.60; Filling c-ts-mode documentation is broken Damien Cassou
2024-07-14 18:44 ` Eli Zaretskii
2024-07-17  4:18   ` Yuan Fu

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.