# HG changeset patch # User Juri Linkov # Date 1096950161 0 # Node ID e2c34e75e585f2189f17ef51ac180cf063519ede # Parent 96251cfe3d1c42794c6d97611335ae65bf8f7117 (isearch-done): Set mark after running hook. Suggested by Drew Adams . diff -r 96251cfe3d1c -r e2c34e75e585 lisp/isearch.el --- a/lisp/isearch.el Mon Oct 04 23:49:32 2004 +0000 +++ b/lisp/isearch.el Tue Oct 05 04:22:41 2004 +0000 @@ -680,16 +680,7 @@ (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)) - - ;; If there was movement, mark the starting position. - ;; Maybe should test difference between and set mark iff > threshold. - (if (/= (point) isearch-opoint) - (or (and transient-mark-mode mark-active) - (progn - (push-mark isearch-opoint t) - (or executing-kbd-macro (> (minibuffer-depth) 0) - (message "Mark saved where search started")))))) + (set-window-start (selected-window) found-start t))) (setq isearch-mode nil) (if isearch-input-method-local-p @@ -714,6 +705,16 @@ (isearch-update-ring isearch-string isearch-regexp)) (run-hooks 'isearch-mode-end-hook) + + ;; If there was movement, mark the starting position. + ;; Maybe should test difference between and set mark iff > threshold. + (if (/= (point) isearch-opoint) + (or (and transient-mark-mode mark-active) + (progn + (push-mark isearch-opoint t) + (or executing-kbd-macro (> (minibuffer-depth) 0) + (message "Mark saved where search started"))))) + (and (not edit) isearch-recursive-edit (exit-recursive-edit))) (defun isearch-update-ring (string &optional regexp)