* lisp/isearch.el: Exit Isearch after deleting the frame (bug#41338).

(isearch-mode): Add 'isearch-done' to 'delete-frame-functions'.
(isearch-done): Remove 'isearch-done' from 'delete-frame-functions'.
This commit is contained in:
Juri Linkov 2024-07-23 21:00:23 +03:00
parent 6760cedc5e
commit 19a18e487b

View file

@ -1339,6 +1339,7 @@ used to set the value of `isearch-regexp-function'."
(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
@ -1458,6 +1459,7 @@ If NOPUSH is non-nil, we don't push the string on the search ring."
(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