Subject: bug#46814: 26.3; Visual-line-mode produces fake newline if line begins with space

From: Kévin Le Gouguec <[email-masked]>
Date: Sat, 27 Feb 2021 23:14:40 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: "Miguel V. S. Frasson" <[email-masked]>
>> Date: Sat, 27 Feb 2021 13:30:23 -0300
>> 
>> In visual-line-mode, if after leading whitespace it follows very long
>> text without spaces, it occurs a visual line break after the leading
>> whitespace, creating an false blank line, annoying users because extra
>> blank lines may change the meaning of text.
>> 
>> It would be more sensible in visual-line-mode forbids visual line breaks
>> after leading whitespace, because they always create blank lines.
>
> Patches are welcome to implement this.  Word of warning: the current
> implementation of this is in C, as part of the display engine, and
> it's very complex.

Should this be merged with bug#11759 and bug#31666?  Skimming [1], I get
the impression that this new report describes a similar problem, i.e.
visual-line-mode refusing to break a word preceded by whitespace.
Quoting Clément :

>                If breaking before a word doesn't prevent that word
> from being broken, it would seem better to not break before it.  In
> other words, assuming 9 columns:
>
> Here breaking at ' ' is useful:
> 
>   Input:
>   123456789
>   xxx aaaaaaa
> 
>   Visual-line mode (good)
>   123456789
>   xxx
>   aaaaaaa
> 
> But not here:
> 
>   Input
>   123456789
>   xxx aaaaaaaaaaaaa
> 
>   Visual-line mode (bad):
>   123456789
>   xxx
>   aaaaaaaaa
>   aaaa
> 
>   What I'd expect:
>   123456789
>   xxx aaaaa
>   aaaaaaaa

Apologies if I've missed some subtleties.

[1] bug#31666#11
    <[email-masked]>
    https://lists.gnu.org/archive/html/bug-gnu-emacs/2018-05/msg00894.html