From 0b9fe9c814c30b7715b55f769352e4200e3aea63 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Wed, 30 Mar 2016 03:12:11 +0200 Subject: [PATCH 1/1] Set initial input for replace when coming from el-search-pattern --- packages/el-search/el-search.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index 77faf7bfa..1f4014a01 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -1117,8 +1117,12 @@ Hit any key to proceed." (defun el-search-query-replace--read-args () (barf-if-buffer-read-only) - (let ((from-input (el-search--read-pattern "Query replace pattern: " nil nil - 'el-search-query-replace-history)) + (let ((from-input (let ((el-search--initial-mb-contents + (or el-search--initial-mb-contents + (and (eq last-command 'el-search-pattern) + (car el-search-history))))) + (el-search--read-pattern "Query replace pattern: " nil nil + 'el-search-query-replace-history))) from to) (with-temp-buffer (emacs-lisp-mode) -- 2.39.2