GNU bug report logs -
#50840
28.0.50; Support GNU style of multiline comments in C source code
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Mon, 27 Sep 2021 07:57:02 UTC
Severity: wishlist
Found in version 28.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #31 received at 50840 <at> debbugs.gnu.org (full text, mbox):
> The actual use case is to convert a block of comments like this:
>
> // First line
> // continuation line with more text,
> // more text. And another sentence
> // which continues here.
>
> to our comment style. I thought it was easy: first uncomment the
> region, then comment the region using the proper style. But there's
> no style to take a sequence of lines like this:
>
> First line
> continuation line with more text,
> more text. And another sentence
> which continues here.
>
> and make it look like this:
>
> /* First line
> continuation line with more text,
> more text. And another sentence
> which continues here. */
Ah, now that makes sense, thanks.
>> If you want comment-region to produce something like the above, then
>> maybe a patch like the following would make sense?
> It's late down here, so instead of applying the patch and playing with
> it, let me ask you: will this patch support the above use case?
I don't think so because it will fail to indent the last 3 lines by the
extra 3 spaces.
>> The idea is to add a new value nil to `comment-style` which would
>> instruct `comment-region` to refrain from adding `comment-continue` on
>> eachline of a multiline comment.
> The value nil doesn't sound like a good mnemonic. I think the style I
> have in mind is a multi-line style, just without the "* " leader on
> each line.
Right (though you do want to use a leader on each line, just one of " "
instead of " * "), but `comment-styles` doesn't have a field to specify
that the comment-continuation should be empty, so I was going for
a cheaper solution.
I'll try again later for something less cheap ;-)
Stefan
This bug report was last modified 2 years and 320 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.