summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2006-05-31 22:48:31 +0000
committerJuri Linkov <juri@jurta.org>2006-05-31 22:48:31 +0000
commit2bf2b947056917796033acf2e975539b96024fda (patch)
tree1fd1f8ea16f70c195ce518073946bc7e6efecb95 /lisp/replace.el
parent8ba7e5409ccbed8dd4fff03c8d2f0e337ad3d42e (diff)
downloademacs-2bf2b947056917796033acf2e975539b96024fda.tar.gz
(query-replace-read-from, query-replace-read-to):
Bind `history-add-new-input' to nil. Call `add-to-history'.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 72236c298cd..2f8fe86860c 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -99,7 +99,8 @@ The return value can also be a pair (FROM . TO) indicating that the user
wants to replace FROM with TO."
(if query-replace-interactive
(car (if regexp-flag regexp-search-ring search-ring))
- (let ((from
+ (let* ((history-add-new-input nil)
+ (from
;; The save-excursion here is in case the user marks and copies
;; a region in order to specify the minibuffer input.
;; That should not clobber the region for the query-replace itself.
@@ -117,6 +118,7 @@ wants to replace FROM with TO."
(cons (car query-replace-defaults)
(query-replace-compile-replacement
(cdr query-replace-defaults) regexp-flag))
+ (add-to-history query-replace-from-history-variable from nil t)
;; Warn if user types \n or \t, but don't reject the input.
(and regexp-flag
(string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)
@@ -174,10 +176,12 @@ the original string if not."
"Query and return the `to' argument of a query-replace operation."
(query-replace-compile-replacement
(save-excursion
- (let ((to (read-from-minibuffer
- (format "%s %s with: " prompt (query-replace-descr from))
- nil nil nil
- query-replace-to-history-variable from t)))
+ (let* ((history-add-new-input nil)
+ (to (read-from-minibuffer
+ (format "%s %s with: " prompt (query-replace-descr from))
+ nil nil nil
+ query-replace-to-history-variable from t)))
+ (add-to-history query-replace-to-history-variable to nil t)
(setq query-replace-defaults (cons from to))
to))
regexp-flag))