emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] fix/undo-point-in-wrong-place dc9024f 2/4: Automated Test


From: Phillip Lord
Subject: [Emacs-diffs] fix/undo-point-in-wrong-place dc9024f 2/4: Automated Test for regression in undo.
Date: Fri, 20 Nov 2015 22:13:22 +0000

branch: fix/undo-point-in-wrong-place
commit dc9024fd5334e47b10f9b863ed3b059328d7f268
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>

    Automated Test for regression in undo.
    
    Point is being left in the wrong place after an undo.
---
 problem.org                   |   17 +++++++++++++++++
 test/automated/simple-test.el |   23 +++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/problem.org b/problem.org
index 359b9f5..c56428c 100644
--- a/problem.org
+++ b/problem.org
@@ -1,4 +1,21 @@
 
+* Point Location Wrong
+
+** Repeatable Cause
+1. Start emacs -Q
+2. Delete the word "buffer"
+3. Move up a couple of lines, and delete the word "want".
+4. undo
+5. Point will be left at where you deleted the word "buffer".
+
+> Also, can you try:
+>
+> (setq undo-auto--current-boundary-timer t)
+>
+> and see if that stops it.
+
+No. Still same thing.
+
 
 * Before Change
 
diff --git a/test/automated/simple-test.el b/test/automated/simple-test.el
index 07b5eaa..4e581ba 100644
--- a/test/automated/simple-test.el
+++ b/test/automated/simple-test.el
@@ -252,5 +252,28 @@
                  '("(s1) (s4)" . " (s2) (s3) (s5)"))))
 
 
+;; Test for a regression introduced by undo-auto--boundaries changes.
+;; https://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01652.html
+(defun undo-test-kill-c-a-then-undo ()
+  (with-temp-buffer
+    (switch-to-buffer (current-buffer))
+    (setq buffer-undo-list nil)
+    (insert "a\nb\n\c\n")
+    (goto-char (point-max))
+    ;; delete c, then a, then undo
+    (kmacro-call-macro nil nil nil
+                       [left backspace left left left
+                             backspace
+                             67108911
+                             ])
+    (point)))
+
+(ert-deftest undo-point-in-wrong-place ()
+  (should
+   ;; returns 5 with the bug
+   (= 2
+      (undo-test-kill-c-a-then-undo))))
+
+
 (provide 'simple-test)
 ;;; simple-test.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]