(add-hook 'pre-command-hook 'isearch-pre-command-hook)
(add-hook 'post-command-hook 'isearch-post-command-hook)
(add-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer)
+ (add-hook 'delete-frame-functions 'isearch-done)
(add-hook 'kbd-macro-termination-hook 'isearch-done)
;; If the keyboard is not up and the last event did not come from
(remove-hook 'pre-command-hook 'isearch-pre-command-hook)
(remove-hook 'post-command-hook 'isearch-post-command-hook)
(remove-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer)
+ (remove-hook 'delete-frame-functions 'isearch-done)
(remove-hook 'kbd-macro-termination-hook 'isearch-done)
(when (buffer-live-p isearch--current-buffer)
(with-current-buffer isearch--current-buffer