Subject: bug#19200: Point adjustemnt moves *into* invisible text

From: Michael Heerdegen <[email-masked]>
Date: Mon, 21 Mar 2016 15:52:55 +0100

Stefan Monnier <[email-masked]> writes:

> move-to-column moves forward from BOL, whereas beginning-of-line moves
> only backward, so the two probably end up at opposite ends of the
> invisible region.
>
> BTW, regardless of fixing this bug, I think you have a problem: if the
> exact position within the invisible text is so important that it can
> end up
> selecting a different line, then fixing bug#19200 won't do you much
> good: there are many cases where point-adjustment won't do what you want
> (e.g. it won't move point at all, even though it's somewhere in the
> middle of the invisible region) and hence it will end up "at the wrong
> place".
>
> The way point-adjustment is defined is too conservative for that.
> So I suggest you try and make you code more robust w.r.t the position of
> point within an invisible region in any case.

Well, we just want that cursor movement starting from a visible position
not end up at an invisible position - the docs seem to suggest that this
should not happen, right?

We have the following, very simple situation:

Line N
{ M invisible lines here }
Line N+M+1

Line N and Line N+M+1 are completely visible, and displayed after each
other.  Point is at the start of Line N, no invisible text near that
position.  Now I hit [down] one time and end up somewhere inside the
invisible text in between.

Michael.