GNU bug report logs - #47167
Multi-line comment-region with empty comment-continue

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 15 Mar 2021 17:11:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "47167 <at> debbugs.gnu.org" <47167 <at> debbugs.gnu.org>
Subject: bug#47167: [External] : bug#47167: Multi-line comment-region with empty comment-continue
Date: Wed, 17 Mar 2021 19:04:20 +0200
>> 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.




This bug report was last modified 4 years and 128 days ago.

Previous Next


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