summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-01-30 23:34:50 +0000
committerRichard M. Stallman <rms@gnu.org>1998-01-30 23:34:50 +0000
commitbdb1c08fb956fe149cfdf609f7f152c2ec152992 (patch)
tree299bb541048f4a1b5bde3c54992802d459872f8a /lisp/replace.el
parent7977773d3fa03d439eb931013656f6114cb21ac4 (diff)
downloademacs-bdb1c08fb956fe149cfdf609f7f152c2ec152992.tar.gz
(query-replace-from-history-variable): New variable.
(query-replace-to-history-variable): New variable. (query-replace-read-args): Use them.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el21
1 files changed, 19 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index b38a8165720..0542b8df371 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -37,16 +37,33 @@
"Non-nil means `query-replace' uses the last search string.
That becomes the \"string to replace\".")
+(defcustom query-replace-from-history-variable 'query-replace-history
+ "History list to use for the FROM argument of query-replace commands.
+The value of this variable should be a symbol; that symbol
+is used as a variable to hold a history list for the strings
+or patterns to be replaced."
+ :group 'matching
+ :type 'symbol)
+
+(defcustom query-replace-to-history-variable 'query-replace-history
+ "History list to use for the TO argument of query-replace commands.
+The value of this variable should be a symbol; that symbol
+is used as a variable to hold a history list for replacement
+strings or patterns."
+ :group 'matching
+ :type 'symbol)
+
(defun query-replace-read-args (string regexp-flag)
(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: " string)
nil nil nil
- 'query-replace-history nil t)))
+ query-replace-from-history-variable
+ nil t)))
(setq to (read-from-minibuffer (format "%s %s with: " string from)
nil nil nil
- 'query-replace-history nil t))
+ query-replace-to-history-variable nil t))
(list from to current-prefix-arg)))
(defun query-replace (from-string to-string &optional arg)