diff options
| author | Richard M. Stallman | 1998-02-08 07:34:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-02-08 07:34:28 +0000 |
| commit | 4a8f3b3db0bf34a207d82d832accdd8d56568b27 (patch) | |
| tree | 42099abe5d5a0e1d38d8e46381b94e9bdf6dfa26 /lisp/replace.el | |
| parent | 8845349022cc3223c299bd9107c23262de4e302d (diff) | |
| download | emacs-4a8f3b3db0bf34a207d82d832accdd8d56568b27.tar.gz emacs-4a8f3b3db0bf34a207d82d832accdd8d56568b27.zip | |
(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.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 0542b8df371..56dee79c44a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -63,7 +63,7 @@ strings or patterns." | |||
| 63 | nil t))) | 63 | nil t))) |
| 64 | (setq to (read-from-minibuffer (format "%s %s with: " string from) | 64 | (setq to (read-from-minibuffer (format "%s %s with: " string from) |
| 65 | nil nil nil | 65 | nil nil nil |
| 66 | query-replace-to-history-variable nil t)) | 66 | query-replace-to-history-variable from t)) |
| 67 | (list from to current-prefix-arg))) | 67 | (list from to current-prefix-arg))) |
| 68 | 68 | ||
| 69 | (defun query-replace (from-string to-string &optional arg) | 69 | (defun query-replace (from-string to-string &optional arg) |
| @@ -142,7 +142,7 @@ before rotating to the next." | |||
| 142 | (format "Query replace %s with (space-separated strings): " | 142 | (format "Query replace %s with (space-separated strings): " |
| 143 | from) | 143 | from) |
| 144 | nil nil nil | 144 | nil nil nil |
| 145 | 'query-replace-history nil t)) | 145 | 'query-replace-history from t)) |
| 146 | (list from to current-prefix-arg))) | 146 | (list from to current-prefix-arg))) |
| 147 | (let (replacements) | 147 | (let (replacements) |
| 148 | (if (listp to-strings) | 148 | (if (listp to-strings) |
| @@ -423,7 +423,8 @@ the matching is case-sensitive." | |||
| 423 | default) | 423 | default) |
| 424 | "List lines matching regexp: ") | 424 | "List lines matching regexp: ") |
| 425 | nil nil nil 'regexp-history default t))) | 425 | nil nil nil 'regexp-history default t))) |
| 426 | (set-text-properties 0 (length input) nil input) | 426 | (and (equal input "") default |
| 427 | (setq input default)) | ||
| 427 | input) | 428 | input) |
| 428 | current-prefix-arg)) | 429 | current-prefix-arg)) |
| 429 | (let ((nlines (if nlines | 430 | (let ((nlines (if nlines |