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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 24 May 2020 22:09:19 +0300

> From: Stephen Bach <[email-masked]>
> Date: Sun, 24 May 2020 14:30:13 -0400
> 
> The miscounting appears to exist at least as far back as Emacs 24. Might there be a mitigation/workaround?
> I like `compute-motion' despite its complicated signature and complicated return value (and despite its
> apparently rare use in the extended ecosystem) - it's fast and it involves no cursor movement to perform its
> measurements.

Don't use compute-motion.  It is a remnant of the old pre-Emacs 21
display engine, and almost certainly doesn't support tricky display
features.

There are other functions that can do the same job.  If you describe
what you need to do, I could try suggesting some alternatives that
will work.