diff lisp/isearch.el @ 91073:4bc33ffdda1a

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 902-908) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 131-137) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 261-262) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-278
author Miles Bader <miles@gnu.org>
date Sat, 27 Oct 2007 09:12:07 +0000
parents 14c4a6aac623 6c0aa34f6c37
children 880960b70474
line wrap: on
line diff
--- a/lisp/isearch.el	Sat Oct 27 00:30:50 2007 +0000
+++ b/lisp/isearch.el	Sat Oct 27 09:12:07 2007 +0000
@@ -2031,8 +2031,13 @@
 			   (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 ()