summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2005-02-19 13:09:37 +0000
committerEli Zaretskii <eliz@gnu.org>2005-02-19 13:09:37 +0000
commitaa5d8645cad411dff1293f80c7aa00f658da3788 (patch)
treec10e393eb4cef7d5fb2b949432ee647687e1576c /lisp/replace.el
parentb3608da909790420b25b05cb84f2c063b1b69cc6 (diff)
downloademacs-aa5d8645cad411dff1293f80c7aa00f658da3788.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)