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

Previous Next

Package: emacs;

Reported by: Stephen Bach <sjbach <at> sjbach.com>

Date: Sun, 24 May 2020 18:45:01 UTC

Severity: normal

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Bach <sjbach <at> sjbach.com>
Cc: 41513 <at> debbugs.gnu.org
Subject: bug#41513: `compute-motion' can miscount buffer positions in the presence of 'before-string/'after-string overlays
Date: Tue, 26 May 2020 22:09:23 +0300
> From: Stephen Bach <sjbach <at> sjbach.com>
> Date: Tue, 26 May 2020 14:12:10 -0400
> Cc: 41513 <at> debbugs.gnu.org
> 
> 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)

save-excursion should do, usually.

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

You are welcome.




This bug report was last modified 4 years and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.