diff options
author | Nitish Chandra <nitishchandrachinta@gmail.com> | 2017-06-17 03:46:12 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2017-06-17 03:55:36 +0300 |
commit | e17d6e2f6f0b7e33f16884bcb29b4d5f4433941b (patch) | |
tree | 6a1dc7f8351fe7180ea838f9b4425e394e5aceac /lisp | |
parent | 3b6e01cccf89ba0f3485751125f43463bc429345 (diff) | |
download | emacs-e17d6e2f6f0b7e33f16884bcb29b4d5f4433941b.tar.gz |
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
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/simple.el | 8 |
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." (goto-char pos)) ;; Adjust the valid marker adjustments (dolist (adj valid-marker-adjustments) - (set-marker (car adj) - (- (car adj) (cdr adj)))))) + ;; Insert might have invalidated some of the markers + ;; via modification hooks. Update only the currently + ;; valid ones (bug#25599). + (if (marker-buffer (car adj)) + (set-marker (car adj) + (- (car adj) (cdr adj))))))) ;; (MARKER . OFFSET) means a marker MARKER was adjusted by OFFSET. (`(,(and marker (pred markerp)) . ,(and offset (pred integerp))) (warn "Encountered %S entry in undo list with no matching (TEXT . POS) entry" |