X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/a444a3e359b6f6f5a4e8afb60cc37d595e9e86e3..122215ea485bb61d4863085815b799dd707f3a56:/packages/el-search/el-search.el diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index f6c8c48e0..2f69f5f87 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -952,8 +952,13 @@ Hit any key to proceed." (barf-if-buffer-read-only) (el-search-search-and-replace-pattern from to mapping)) -(defun el-search--take-over-from-isearch () - (prog1 isearch-string (isearch-exit))) +(defun el-search--take-over-from-isearch (&optional goto-left-end) + (let ((other-end (and goto-left-end isearch-other-end)) + (input isearch-string)) + (isearch-exit) + (when (and other-end (< other-end (point))) + (goto-char other-end)) + input)) ;;;###autoload (defun el-search-search-from-isearch () @@ -968,7 +973,7 @@ Hit any key to proceed." ;;;###autoload (defun el-search-replace-from-isearch () (interactive) - (let ((el-search--initial-mb-contents (concat "'" (el-search--take-over-from-isearch)))) + (let ((el-search--initial-mb-contents (concat "'" (el-search--take-over-from-isearch t)))) (call-interactively #'el-search-query-replace)))