changeset 75025:edd6516d483d

(isearch-done): Use FOUND-POINT or FOUND-START only if we restored isearch-window-configuration.
author Richard M. Stallman <rms@gnu.org>
date Mon, 01 Jan 2007 21:48:59 +0000
parents 6cf73d2a2aa9
children a39dfae2c4f7
files lisp/isearch.el
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/isearch.el	Mon Jan 01 19:03:59 2007 +0000
+++ b/lisp/isearch.el	Mon Jan 01 21:48:59 2007 +0000
@@ -784,13 +784,15 @@
   (lazy-highlight-cleanup lazy-highlight-cleanup)
   (let ((found-start (window-start (selected-window)))
 	(found-point (point)))
-    (if isearch-window-configuration
-	(set-window-configuration isearch-window-configuration))
-
-    (if isearch-small-window
-	(goto-char found-point)
-      ;; Exiting the save-window-excursion clobbers window-start; restore it.
-      (set-window-start (selected-window) found-start t)))
+    (when isearch-window-configuration
+      (set-window-configuration isearch-window-configuration)
+      (if isearch-small-window
+	  (goto-char found-point)
+	;; set-window-configuration clobbers window-start; restore it.
+	;; This has an annoying side effect of clearing the last_modiff
+	;; field of the window, which can cause unwanted scrolling,
+	;; so don't do it unless truly necessary.
+	(set-window-start (selected-window) found-start t))))
 
   (setq isearch-mode nil)
   (if isearch-input-method-local-p