bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47167: [External] : bug#47167: Multi-line comment-region with empty


From: Juri Linkov
Subject: bug#47167: [External] : bug#47167: Multi-line comment-region with empty comment-continue
Date: Wed, 17 Mar 2021 19:04:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> With (setq-local comment-style 'extra-line comment-continue ""),
>> `comment-region' currently breaks HTML syntax
>> because HTML doesn't support nested comments:
>>
>> <!--
>> <!-- line 1 -->
>> <!-- line 2 -->
>> <!-- line 3 -->
>>   -->
>>
>> With the proposed patch, HTML syntax stays valid:
>>
>> <!--
>> line 1
>> line 2
>> line 3
>>   -->
>
> I see, I guess.  But why change `comment-region',
> instead of creating a new command for multi-line
> (aka block) commenting?

'multi-line' is just one of possible styles in 'comment-styles'.
I'm not interested in creating separate commands for each style.
If you want, you can create a separate bug report.

> If there's a bug now (e.g. wrt `comment-continue')
> when someone uses `comment-region', then maybe
> either that can be fixed (without involving
> multiline) or that command can be made to ignore,

Indeed, there is a bug.  The documentation of 'comment-continue' says:

  Continuation string to insert for multiline comments.

  If it is nil a value will be automatically derived from ‘comment-start’
  by replacing its first character with a space.

The problem is that currently the empty string behaves as if it's nil.
The patch fixes it.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]