154 |
"Function(s) to call after starting up an incremental search.") |
"Function(s) to call after starting up an incremental search.") |
155 |
|
|
156 |
(defvar isearch-mode-end-hook nil |
(defvar isearch-mode-end-hook nil |
157 |
"Function(s) to call after terminating an incremental search.") |
"Function(s) to call after terminating an incremental search. |
158 |
|
When these functions are called, `isearch-mode-end-hook-quit' |
159 |
|
is non-nil if the user quit the search.") |
160 |
|
|
161 |
|
(defvar isearch-mode-end-hook-quit nil |
162 |
|
"Non-nil while running `isearch-mode-end-hook' if user quit the search.") |
163 |
|
|
164 |
(defvar isearch-wrap-function nil |
(defvar isearch-wrap-function nil |
165 |
"Function to call to wrap the search when search is failed. |
"Function to call to wrap the search when search is failed. |
749 |
(setq disable-point-adjustment t)) |
(setq disable-point-adjustment t)) |
750 |
|
|
751 |
(defun isearch-done (&optional nopush edit) |
(defun isearch-done (&optional nopush edit) |
752 |
|
"Exit Isearch mode. |
753 |
|
For successful search, pass no args. |
754 |
|
For a failing search, NOPUSH is t. |
755 |
|
For going to the minibuffer to edit the search string, |
756 |
|
NOPUSH is t and EDIT is t." |
757 |
|
|
758 |
(if isearch-resume-in-command-history |
(if isearch-resume-in-command-history |
759 |
(let ((command `(isearch-resume ,isearch-string ,isearch-regexp |
(let ((command `(isearch-resume ,isearch-string ,isearch-regexp |
760 |
,isearch-word ,isearch-forward |
,isearch-word ,isearch-forward |
806 |
;; Update the ring data. |
;; Update the ring data. |
807 |
(isearch-update-ring isearch-string isearch-regexp)) |
(isearch-update-ring isearch-string isearch-regexp)) |
808 |
|
|
809 |
(run-hooks 'isearch-mode-end-hook) |
(let ((isearch-mode-end-hook-quit (and nopush (not edit)))) |
810 |
|
(run-hooks 'isearch-mode-end-hook)) |
811 |
|
|
812 |
;; If there was movement, mark the starting position. |
;; If there was movement, mark the starting position. |
813 |
;; Maybe should test difference between and set mark iff > threshold. |
;; Maybe should test difference between and set mark iff > threshold. |