summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2016-09-03 23:38:35 -0400
committerNoam Postavsky <npostavs@gmail.com>2016-09-10 09:13:09 -0400
commit68f4b5292781bc331b040105c4079902b993835c (patch)
tree41915edb4e3077ad99539b04c2b7be51a1b1a8fe /lisp
parent367f8568bc9e759ebdfb423648891efa0346456b (diff)
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/isearch.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index b50379a250..39ed8af370 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1045,9 +1045,10 @@ NOPUSH is t and EDIT is t."
(remove-hook 'mouse-leave-buffer-hook 'isearch-done)
(remove-hook 'kbd-macro-termination-hook 'isearch-done)
(setq isearch-lazy-highlight-start nil)
- (with-current-buffer isearch--current-buffer
- (setq isearch--current-buffer nil)
- (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))
+ (when (buffer-live-p isearch--current-buffer)
+ (with-current-buffer isearch--current-buffer
+ (setq isearch--current-buffer nil)
+ (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))))
;; Called by all commands that terminate isearch-mode.
;; If NOPUSH is non-nil, we don't push the string on the search ring.