Subject: Re: bug#2749: 23.0.91; Visual Line Mode: incorrect line wrapping in corner case

From: Stephen Berman <[email-masked]>
Date: Sat, 18 May 2013 22:30:00 +0200

On Fri, 10 May 2013 22:31:53 +0300 Eli Zaretskii <[email-masked]> wrote:

>> From: Stephen Berman <[email-masked]>
[...]
>> I may be misunderstanding you here, but it sounds like you think the
>> patch to enable overflow-newline-into-fringe in Visual Line mode is
>> already in the trunk; it isn't.
>
> I know.  I said "imagine" because I understand this change is not in
> the repository.
>
>> But if it were now enabled (with my patch) and your patch were also
>> added (to prevent the problem I reported today), then Org and magit
>> users and others will be able to see if other problems do arise.
>
> I suspect subtle issues will be triggered by this change in modes that
> make heavy use of display properties.  But if Stefan is willing to
> take that risk, let's install this and see what breaks.

I hope Stefan's silence till now just means he hasn't yet had time to
give this issue due consideration....

In the mean time, I've encountered another problem, which has nothing to
do with display properties or overlays:

-1. Apply both my patch and yours (Eli's).
0. emacs -Q
1. Type `a RET C-80 x RET b' to insert three line of text, of which the
   second runs the width of the window, up to the right fringe.
2. M-x visual-line-mode 
3. With point on `a', type `C-n': now point is on the first `x' of the
   second inserted line.
Here's the first instance of the problem:
4. Type `C-n' again: now point is in the fringe at the end of the line
   of x's.
Here's the next instance of the problem:
5. Type `C-p': now point is back on the first `x' of the second inserted
   line.

(If you type `C-n' again after step 4, so point is on `b' in the third
inserted line, and then type `C-p', now point is back in the fringe at
the end of the line of x's.  I assume this is not an instance of the
problem, but point moving correctly back to the goal column.)
 
As you've no doubt guessed by now, the problem occurs in
vertical-motion, and can be reproduced by replacing `C-n' and `C-p' in
the recipe by `M-: (vertical-motion 1)' and `M-: (vertical-motion -1)',
respectively.  I tried to debug it but my GDB skills are unfortunately
too limited; if you feel like advising me, I'm all ears.  Otherwise, it
would be great if you could fix this as quickly as you fixed the last
problem I reported!

Steve Berman