diff options
author | Juri Linkov <juri@jurta.org> | 2007-10-22 23:44:29 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2007-10-22 23:44:29 +0000 |
commit | d240f431cbbddfeb3ae2ac8a2879ce34bf52d111 (patch) | |
tree | 6465d15beed95cc59b6881ab2c4d303ef681a9e2 /lisp/isearch.el | |
parent | ed779c49f334e8e3f6017ffed3adababfb7cac7b (diff) | |
download | emacs-d240f431cbbddfeb3ae2ac8a2879ce34bf52d111.tar.gz |
(isearch-search-string): After finding the next
occurrence switch to buffer isearch-buffers-current-buffer when
isearch-buffers-next-buffer-function is non-nil and
isearch-buffers-current-buffer is live.
Diffstat (limited to 'lisp/isearch.el')
-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." (if isearch-forward (< pos2 pos1) (> pos2 pos1)))) (setq pos1 pos2) (set-match-data match-data))))) - (if pos1 - (goto-char pos1)) + (when pos1 + ;; When using multiple buffers isearch, switch to the new buffer here, + ;; because `save-excursion' above doesn't allow doing it inside funcall. + (if (and isearch-buffers-next-buffer-function + (buffer-live-p isearch-buffers-current-buffer)) + (switch-to-buffer isearch-buffers-current-buffer)) + (goto-char pos1)) pos1)) (defun isearch-search () |