[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#75978: 31.0.50; Using fill-region doesn't produce commented lines in
From: |
Yuan Fu |
Subject: |
bug#75978: 31.0.50; Using fill-region doesn't produce commented lines in go-ts-mode |
Date: |
Tue, 11 Feb 2025 20:42:41 -0800 |
> On Feb 8, 2025, at 2:47 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> Date: Fri, 31 Jan 2025 19:21:40 +0000
>> From: the_wurfkreuz via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> I noticed that, unlike in other built-in language modes, in go-ts-mode,
>> using fill-region on a comment line
>> doesn't automatically comment the new line.
>>
>> Steps to reproduce:
>> 1. emacs -Q
>> 2. Paste this text so that it takes only a single line: "To make our
>> function interact with Waitgroup, we need to
>> send a reference to this group. Once we have its reference, the function can
>> defer, calling Done(), to ensure
>> that we signal correctly for our group every time the function is complete."
>> 3. Run set-mark-command and select the whole line using
>> move-beginning-of-line.
>> 4. Enable go-ts-mode (assuming that the grammar is already compiled).
>> 5. Use comment-region on the selected text.
>> 6. Then select the whole line again and execute fill-region.
>> The newly created lines aren't commented. If I do the same thing in
>> python-ts-mode, the new lines are commented out.
>
> Randy and Yuan, any comments or suggestions?
Thanks Eli, I pushed a fix to emcs-30. Go-ts-mode wasn’t setting
fill-paragraph-function, so it doesn’t know how to fill comments.
Yuan