Subject: bug#5437: C-q reformat and Autofill error

From: Chong Yidong <[email-masked]>
Date: Fri, 22 Jan 2010 11:41:28 -0500

> When I edit the beginning of the first line with an "-" character, and
> reformat using M-q, I expected all the lines to be indented
>
> Instead, after adding the '-' at the beginning, and reformatting with
> M-q, what I get is normal wrapping of the text
>
> This appears to be a bug, because it only seems to happens when the
> first line of the text is edited after the fact. If I include the '-'
> character when I first start typing the multiple lines, I get the
> indented wrapping that I expected. Additionally if I join the lines
> back together, and then type M-q, I get the expected indented
> wrapping.

This is not a bug, it's part of the indentation logic.  Emacs has no way
of knowing whether you intend to indent like this:

- foo goo...
bar baz...

or like this:

- foo goo...
  bar baz...

Clearly, each indentation could be valid under different circumstances,
and Emacs must not impose one single choice when M-q is typed.

So, if you start out with a long line that is not already indented, it
will try option 2.  But if you start out with either choice, it will
stick with that choice.