From 68f4b5292781bc331b040105c4079902b993835c Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 3 Sep 2016 23:38:35 -0400 Subject: Don't require isearch-update before isearch-done It is useful to be able to call `isearch-done' unconditionally to ensure a non-isearching state. * lisp/isearch.el (isearch-done): Check that `isearch--current-buffer' is a live buffer before using it (Bug #21091). * test/lisp/isearch-tests.el (isearch--test-done): Test it. --- test/lisp/isearch-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/lisp/isearch-tests.el b/test/lisp/isearch-tests.el index 48c342403c..52f312d0b9 100644 --- a/test/lisp/isearch-tests.el +++ b/test/lisp/isearch-tests.el @@ -28,5 +28,13 @@ (isearch-update) (should (equal isearch--current-buffer (current-buffer))))) +(ert-deftest isearch--test-done () + ;; Normal operation. + (isearch-update) + (isearch-done) + (should-not isearch--current-buffer) + ;; Bug #21091: let `isearch-done' work without `isearch-update'. + (isearch-done)) + (provide 'isearch-tests) ;;; isearch-tests.el ends here -- cgit v1.2.3