diff options
| -rw-r--r-- | lisp/isearch.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index e0cba48eed9..c9a4cf45664 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2035,8 +2035,13 @@ Can be changed via `isearch-search-fun-function' for special needs." | |||
| 2035 | (if isearch-forward (< pos2 pos1) (> pos2 pos1)))) | 2035 | (if isearch-forward (< pos2 pos1) (> pos2 pos1)))) |
| 2036 | (setq pos1 pos2) | 2036 | (setq pos1 pos2) |
| 2037 | (set-match-data match-data))))) | 2037 | (set-match-data match-data))))) |
| 2038 | (if pos1 | 2038 | (when pos1 |
| 2039 | (goto-char pos1)) | 2039 | ;; When using multiple buffers isearch, switch to the new buffer here, |
| 2040 | ;; because `save-excursion' above doesn't allow doing it inside funcall. | ||
| 2041 | (if (and isearch-buffers-next-buffer-function | ||
| 2042 | (buffer-live-p isearch-buffers-current-buffer)) | ||
| 2043 | (switch-to-buffer isearch-buffers-current-buffer)) | ||
| 2044 | (goto-char pos1)) | ||
| 2040 | pos1)) | 2045 | pos1)) |
| 2041 | 2046 | ||
| 2042 | (defun isearch-search () | 2047 | (defun isearch-search () |