]> code.delx.au - gnu-emacs-elpa/commitdiff
Set initial input for replace when coming from el-search-pattern
authorMichael Heerdegen <michael_heerdegen@web.de>
Wed, 30 Mar 2016 01:12:11 +0000 (03:12 +0200)
committerMichael Heerdegen <michael_heerdegen@web.de>
Thu, 19 May 2016 20:28:14 +0000 (22:28 +0200)
packages/el-search/el-search.el

index 77faf7bfa53904f6f90d41e5b155642374526b5a..1f4014a0114755e33c8aa143b5d39aa60823d1a7 100644 (file)
@@ -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)