Subject: bug#16820: 24.3; nxml comment block indentation issue

From: Nathan Eagleson <[email-masked]>
Date: Mon, 5 Oct 2020 23:09:01 -0400

Sorry, I missed your original request.

This seems like a bug to me because multi-paragraph comment bodies are
usually indented to align with the comment start token.

If you strip trailing whitespace on save, this behavior results in bad
comment indentation, something like:

    <!-- First line of comment is here. It may go on for
    several lines in a format something like you'd expect.

After the blank line, the comment is outdented relative to the
comment start/end markers.

    -->

This is all from distant memory, so apologies if I'm describing it
incorrectly.

-Nate

On Thu, Oct 1, 2020 at 8:12 AM Stefan Kangas <[email-masked]> wrote:

> tags 16820 + wontfix notabug
> close 16820
> thanks
>
> Stefan Kangas <[email-masked]> writes:
>
> > Nate Eagleson <[email-masked]> writes:
> >
> >> nxml-mode indents multiple lines in a comment block to match the
> >> preceding line's indentation, even for blank lines. It should ignore
> >> blank lines when determining indent level.
> > [...]
> >>
> >> To reproduce:
> >>
> >> Start emacs with -Q.
> >>
> >> Create a new buffer.
> >>
> >> Start XML mode: M-x xml-mode
> >>
> >> Enter the following text:
> >>
> >> <test>
> >>  <!-- This is a comment.
> >>
> >> This is the next paragraph in the comment.
> >> -->
> >> </test>
> >>
> >> Put the cursor before '-->' and press Tab. It will indent to the same
> >> level as '<!--'.
> >>
> >> Put the cursor before 'This is the next paragraph in the comment' and
> >> press Tab. Nothing will happen.
> >>
> >> Move up one line to the blank line. Press spacebar twice.
> >>
> >> Move back down a line. Press Tab. The second line will now indent as
> >> expected.
> >
> > I can reproduce this, but I'm not sure this is a bug.  Why shouldn't it
> > take blank lines into consideration?
>
> More information was requested, but none was given within 7 weeks, so
> I'm closing this bug.
>