Subject: bug#19188: point adjustemnt moves *into* invisible text

From: Stefan Monnier <[email-masked]>
Date: Mon, 22 Dec 2014 23:11:27 -0500

> Also required is this hack which relies on `get-text-property' and
> `get-pos-property' disagreeing about the value of `invisible'.

>   (add-hook 'post-command-hook #'magit-post-command-adjust-point t t)

>   (defun magit-post-command-adjust-point ()
>     (when (and (get-text-property (point) 'invisible)
>                (not (if (fboundp 'get-pos-property) ; since 24.4, see #1671
>                         (get-pos-property (point) 'invisible)
>                       (get-text-property (1+ (point)) 'invisible))))
>       (goto-char (next-single-char-property-change (point) 'invisible))))

> Is there a better way?

I don't know, because I don't know what it's trying to do.

> It is especially confusing when only point is adjusted and the cursor
> stays were it would have been without the adjustment of point.

IIUC you're describing a situation where the display is incorrect, so
I think this would be a bug.

>> But indeed C-n gets me to position 5, which is wrong (and doing M-: (point)
>> returns 5 but moves me to position 3, so doing it again returns 3 :-( ).
>> So we do have a bug here.

I filed a separate bug report about this problem.

        Stefan