Subject: bug#41513: `compute-motion' can miscount buffer positions in the presence of 'before-string/'after-string overlays

From: Stephen Bach <[email-masked]>
Date: Tue, 26 May 2020 14:12:10 -0400

On Tue, May 26, 2020 at 12:21 PM Eli Zaretskii <[email-masked]> wrote:
>
> Depending on what exactly do you need to do, I can suggest the
> following APIs:
>
>   vertical-motion
>   posn-at-point
>   pos-visible-in-window-p
>   window-text-pixel-size
>
> Let me know if these don't cover the functionalities that you need.

I overlooked pos-visible-in-window-p before, thanks for the reference.

Do you have any points of advice for avoiding side-effects when moving
the cursor around the buffer programmatically?

What I have so far:
- Wrap in save-excursion
- Bind to t:
  - inhibit-point-motion-hooks
  - cursor-sensor-inhibit
  - inhibit-field-text-motion (for precision, might be superfluous)
- Bind to nil:
  - goal-column (probably superfluous)

Thanks Eli, I appreciate the help and also the work you do for Emacs.