Subject: bug#25599: Why edit markers after insert?

From: Andreas Schwab <[email-masked]>
Date: Wed, 08 Mar 2017 18:39:23 +0100

On Mär 08 2017, nitish chandra <[email-masked]> wrote:

> In primitive-undo in simple.el, aroud line 2550 (in master) we adjust the
> markers after the insertion.
>
> (dolist (adj valid-marker-adjustments)
>                (set-marker (car adj)
>                            (- (car adj) (cdr adj))))
>
> Why is this needed? Won't insert take care of adjusting the markers?

Only marker originally pointing inside the deleted region were recorded
here, and this is to make sure they regain their previous position after
the reinsertion.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."