diff options
| author | Eli Zaretskii | 2005-02-19 13:12:21 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2005-02-19 13:12:21 +0000 |
| commit | 2511035dc74e5637fb020eefdb193f3dd3e810b8 (patch) | |
| tree | 7b3aba36df81bd5f7a1f71464923063c818b5397 /lisp/replace.el | |
| parent | 7363960176f37dd33b99bd9a76f0fe8c82768042 (diff) | |
| download | emacs-2511035dc74e5637fb020eefdb193f3dd3e810b8.tar.gz emacs-2511035dc74e5637fb020eefdb193f3dd3e810b8.zip | |
(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.el | 7 |
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." | |||
| 115 | query-replace-from-history-variable | 115 | query-replace-from-history-variable |
| 116 | nil t t)))) | 116 | nil t t)))) |
| 117 | (if (and (zerop (length from)) lastto lastfrom) | 117 | (if (and (zerop (length from)) lastto lastfrom) |
| 118 | (cons lastfrom | 118 | (progn |
| 119 | (query-replace-compile-replacement lastto regexp-flag)) | 119 | (cons lastfrom |
| 120 | (query-replace-compile-replacement lastto regexp-flag)) | ||
| 121 | (set query-replace-from-history-variable | ||
| 122 | (cdr (symbol-value query-replace-from-history-variable)))) | ||
| 120 | ;; Warn if user types \n or \t, but don't reject the input. | 123 | ;; Warn if user types \n or \t, but don't reject the input. |
| 121 | (and regexp-flag | 124 | (and regexp-flag |
| 122 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) | 125 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) |