GNU bug report logs - #75978
31.0.50; Using fill-region doesn't produce commented lines in go-ts-mode

Previous Next

Package: emacs;

Reported by: the_wurfkreuz <the_wurfkreuz <at> proton.me>

Date: Fri, 31 Jan 2025 19:23:02 UTC

Severity: normal

Found in version 31.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 75978-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Randy Taylor <dev <at> rjt.dev>, 75978-done <at> debbugs.gnu.org,
 the_wurfkreuz <the_wurfkreuz <at> proton.me>
Subject: Re: 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 <at> 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 <at> 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





This bug report was last modified 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.