diff options
author | Phillip Lord <phillip.lord@russet.org.uk> | 2016-06-30 22:06:00 +0100 |
---|---|---|
committer | Phillip Lord <phillip.lord@russet.org.uk> | 2016-07-05 09:27:59 +0100 |
commit | d4c6774f40b6ae1fad091f66e8e43913bc9a2724 (patch) | |
tree | e86c38d23d44ecaf095ad79eb0a900dbac13a386 /test | |
parent | 3a9d6296b35e5317c497674d5725eb52699bd3b8 (diff) |
Fix missing point information in undo
* src/undo.c (record_insert): Use record_point instead of
prepare_record, and do so unconditionally.
(prepare_record): Do not record first change.
(record_point): Now conditional on state before the last command.
(record_delete): Call record_point unconditionally.
(record_property_change): Use prepare_record.
(record_marker_adjustments): Use prepare_record.
Addresses Bug# 21722
Diffstat (limited to 'test')
-rw-r--r-- | test/automated/simple-test.el | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/automated/simple-test.el b/test/automated/simple-test.el index 40cd1d2949..c41d01075e 100644 --- a/test/automated/simple-test.el +++ b/test/automated/simple-test.el @@ -311,6 +311,7 @@ (undo-test-point-after-forward-kill)))) (defmacro simple-test-undo-with-switched-buffer (buffer &rest body) + (declare (indent 1) (debug t)) (let ((before-buffer (make-symbol "before-buffer"))) `(let ((,before-buffer (current-buffer))) (unwind-protect @@ -340,8 +341,24 @@ C-/ ;; undo (point-min) (point-max)))))) +(ert-deftest missing-record-point-in-undo () + "Check point is being restored correctly. - +See Bug#21722." + (should + (= 5 + (with-temp-buffer + (generate-new-buffer " *temp*") + (emacs-lisp-mode) + (setq buffer-undo-list nil) + (insert "(progn (end-of-line) (insert \"hello\"))") + (beginning-of-line) + (forward-char 4) + (undo-boundary) + (eval-defun nil) + (undo-boundary) + (undo) + (point))))) (provide 'simple-test) ;;; simple-test.el ends here |