Subject: Re: bug#4318: 23.1; trouble indenting looooong lines with visual-line-mode

From: Eli Zaretskii <[email-masked]>
Date: Sat, 17 Sep 2011 12:42:39 +0300

> From: Lars Magne Ingebrigtsen <[email-masked]>
> Date: Sat, 17 Sep 2011 09:23:14 +0200
> Cc: [email-masked]
> 
> Allan Gottlieb <[email-masked]> writes:
> 
> > yyyy
> > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > So far so good.  Now indent the long line with say one space.
> > If visual-line-mode is OFF, I see what I expect, the long line is
> > preceded by one space.
> >
> > But with visual-line-mode ON, a blank line appears on the screen between
> > the short and long lines, i.e. the long line (with only one word) was
> > wrapped.
> > This behavior seems wrong.
> 
> I can confirm this behaviour in Emacs 24.
> 
> The problem seems to be that `visual-line-mode' breaks long lines after
> any white space -- even if the white space begins the line.  That
> doesn't seem optimal, I think.

The extra line stands for the space that is not shown.  If you place
the cursor on that "empty line" and type "C-x =", you will see that
point is before the space character, not before newline.

So I think visual-line-mode (a.k.a. "word wrap") behaves correctly.
Doing what the OP asks for would also have undesirable side effects,
albeit different ones.  E.g., adding some non-white character at the
beginning of that line will suddenly and mysteriously move the
"xxxx..." part one line down.

And that's even before I consider the potential complications of the
code, which already tracks the word wrap mode with no less than 12
state variables...

My recommendation is to close this bug as "won't fix".