aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert2016-08-05 14:07:00 -0700
committerPaul Eggert2016-08-05 14:07:00 -0700
commit1a86b5d6074d26d1a3a978cb52b2147b6f359694 (patch)
tree5b609435fb29b6f62766ddd51d8649013913970e /test
parentc5823cdae3de078e6db58df25769011ef3e52f36 (diff)
parentd4c6774f40b6ae1fad091f66e8e43913bc9a2724 (diff)
downloademacs-1a86b5d6074d26d1a3a978cb52b2147b6f359694.tar.gz
emacs-1a86b5d6074d26d1a3a978cb52b2147b6f359694.zip
Merge from origin/emacs-25
d4c6774 Fix missing point information in undo 3a9d629 Avoid crashes when buffer modification hooks clobber match data 178b2f5 Note combine-and-quote-strings doesn't shell quote dec7567 Explain when package-initialize isn't called 113d1e2 Fix escaping in sh-indent-after-continuation docstr 80e2044 ; * etc/NEWS: Improve previous change. 5bb9e6c ; * etc/NEWS: Document how to avoid horizontal scroll bars. 38f4b8e Clarify the documentation of back-references in replacements
Diffstat (limited to 'test')
-rw-r--r--test/lisp/simple-tests.el19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 97b6c491629..d022240ae5c 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -325,6 +325,7 @@
325 (undo-test-point-after-forward-kill)))) 325 (undo-test-point-after-forward-kill))))
326 326
327(defmacro simple-test-undo-with-switched-buffer (buffer &rest body) 327(defmacro simple-test-undo-with-switched-buffer (buffer &rest body)
328 (declare (indent 1) (debug t))
328 (let ((before-buffer (make-symbol "before-buffer"))) 329 (let ((before-buffer (make-symbol "before-buffer")))
329 `(let ((,before-buffer (current-buffer))) 330 `(let ((,before-buffer (current-buffer)))
330 (unwind-protect 331 (unwind-protect
@@ -354,8 +355,24 @@ C-/ ;; undo
354 (point-min) 355 (point-min)
355 (point-max)))))) 356 (point-max))))))
356 357
358(ert-deftest missing-record-point-in-undo ()
359 "Check point is being restored correctly.
357 360
358 361See Bug#21722."
362 (should
363 (= 5
364 (with-temp-buffer
365 (generate-new-buffer " *temp*")
366 (emacs-lisp-mode)
367 (setq buffer-undo-list nil)
368 (insert "(progn (end-of-line) (insert \"hello\"))")
369 (beginning-of-line)
370 (forward-char 4)
371 (undo-boundary)
372 (eval-defun nil)
373 (undo-boundary)
374 (undo)
375 (point)))))
359 376
360(provide 'simple-test) 377(provide 'simple-test)
361;;; simple-test.el ends here 378;;; simple-test.el ends here