aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1998-02-08 07:34:28 +0000
committerRichard M. Stallman <[email protected]>1998-02-08 07:34:28 +0000
commit4a8f3b3db0bf34a207d82d832accdd8d56568b27 (patch)
tree42099abe5d5a0e1d38d8e46381b94e9bdf6dfa26 /lisp/replace.el
parent8845349022cc3223c299bd9107c23262de4e302d (diff)
(occur): Apply default by hand after read-from-minibuffer.
No need to clear text props from the result. (query-replace-read-args, map-query-replace-regexp): Offer the FROM arg as the default for the TO arg.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 0542b8df37..56dee79c44 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -63,7 +63,7 @@ strings or patterns."
nil t)))
(setq to (read-from-minibuffer (format "%s %s with: " string from)
nil nil nil
- query-replace-to-history-variable nil t))
+ query-replace-to-history-variable from t))
(list from to current-prefix-arg)))
(defun query-replace (from-string to-string &optional arg)
@@ -142,7 +142,7 @@ before rotating to the next."
(format "Query replace %s with (space-separated strings): "
from)
nil nil nil
- 'query-replace-history nil t))
+ 'query-replace-history from t))
(list from to current-prefix-arg)))
(let (replacements)
(if (listp to-strings)
@@ -423,7 +423,8 @@ the matching is case-sensitive."
default)
"List lines matching regexp: ")
nil nil nil 'regexp-history default t)))
- (set-text-properties 0 (length input) nil input)
+ (and (equal input "") default
+ (setq input default))
input)
current-prefix-arg))
(let ((nlines (if nlines