aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitish Chandra2017-06-17 03:46:12 +0300
committerDmitry Gutov2017-06-17 03:55:36 +0300
commite17d6e2f6f0b7e33f16884bcb29b4d5f4433941b (patch)
tree6a1dc7f8351fe7180ea838f9b4425e394e5aceac
parent3b6e01cccf89ba0f3485751125f43463bc429345 (diff)
downloademacs-e17d6e2f6f0b7e33f16884bcb29b4d5f4433941b.tar.gz
emacs-e17d6e2f6f0b7e33f16884bcb29b4d5f4433941b.zip
primitive-undo: Update only the currently valid markers
* lisp/simple.el (primitive-undo): Update only the currently valid markers (bug#25599). Copyright-paperwork-exempt: yes
-rw-r--r--lisp/simple.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index df664fc0503..a5565ab6e73 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2589,8 +2589,12 @@ Return what remains of the list."
2589 (goto-char pos)) 2589 (goto-char pos))
2590 ;; Adjust the valid marker adjustments 2590 ;; Adjust the valid marker adjustments
2591 (dolist (adj valid-marker-adjustments) 2591 (dolist (adj valid-marker-adjustments)
2592 (set-marker (car adj) 2592 ;; Insert might have invalidated some of the markers
2593 (- (car adj) (cdr adj)))))) 2593 ;; via modification hooks. Update only the currently
2594 ;; valid ones (bug#25599).
2595 (if (marker-buffer (car adj))
2596 (set-marker (car adj)
2597 (- (car adj) (cdr adj)))))))
2594 ;; (MARKER . OFFSET) means a marker MARKER was adjusted by OFFSET. 2598 ;; (MARKER . OFFSET) means a marker MARKER was adjusted by OFFSET.
2595 (`(,(and marker (pred markerp)) . ,(and offset (pred integerp))) 2599 (`(,(and marker (pred markerp)) . ,(and offset (pred integerp)))
2596 (warn "Encountered %S entry in undo list with no matching (TEXT . POS) entry" 2600 (warn "Encountered %S entry in undo list with no matching (TEXT . POS) entry"