summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2005-02-19 13:12:21 +0000
committerEli Zaretskii <eliz@gnu.org>2005-02-19 13:12:21 +0000
commit2511035dc74e5637fb020eefdb193f3dd3e810b8 (patch)
tree7b3aba36df81bd5f7a1f71464923063c818b5397 /lisp/replace.el
parent7363960176f37dd33b99bd9a76f0fe8c82768042 (diff)
downloademacs-2511035dc74e5637fb020eefdb193f3dd3e810b8.tar.gz
(query-replace-read-from): Set the value of
query-replace-from-history-variable to handle the case of an empty string entered to accept the suggested default.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index de3577913c1..eb9f592f01d 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -115,8 +115,11 @@ wants to replace FROM with TO."
query-replace-from-history-variable
nil t t))))
(if (and (zerop (length from)) lastto lastfrom)
- (cons lastfrom
- (query-replace-compile-replacement lastto regexp-flag))
+ (progn
+ (cons lastfrom
+ (query-replace-compile-replacement lastto regexp-flag))
+ (set query-replace-from-history-variable
+ (cdr (symbol-value query-replace-from-history-variable))))
;; Warn if user types \n or \t, but don't reject the input.
(and regexp-flag
(string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)