--- replace.el.ori Tue Aug 5 10:33:01 2003 +++ replace.el Mon Aug 4 19:05:06 2003 @@ -47,7 +47,8 @@ Note that this flag has no effect if `case-fold-search' is nil, or if the replacement text has any uppercase letters in it.") -(defvar query-replace-history nil) +(defvar query-replace-history-from nil) +(defvar query-replace-history-to nil) (defvar query-replace-interactive nil "Non-nil means `query-replace' uses the last search string. @@ -71,13 +72,16 @@ (let (from to) (if query-replace-interactive (setq from (car (if regexp-flag regexp-search-ring search-ring))) - (setq from (read-from-minibuffer (format "%s: " (gettext string)) + (setq from (read-from-minibuffer (format "%s (%s): " (gettext string) + (car query-replace-history-from)) nil nil nil - 'query-replace-history))) - (setq to (read-from-minibuffer (format "%s %s with: " (gettext string) - from) + 'query-replace-history-from + nil (car query-replace-history-from)))) + (setq to (read-from-minibuffer (format "%s %s with (%s): " (gettext string) + from (car query-replace-history-to)) nil nil nil - 'query-replace-history)) + 'query-replace-history-to + nil (car query-replace-history-to))) (list from to current-prefix-arg))) ;; As per suggestion from Per Abrahamsen, limit replacement to the region @@ -143,12 +147,12 @@ (car regexp-search-ring) (read-from-minibuffer "Map query replace (regexp): " nil nil nil - 'query-replace-history))) + 'query-replace-history-from))) (setq to (read-from-minibuffer (format "Query replace %s with (space-separated strings): " from) nil nil nil - 'query-replace-history)) + 'query-replace-history-from)) (list from to current-prefix-arg))) (let (replacements) (if (listp to-strings)