diff options
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/replace.el | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8f320b55992..f60d1e9ea5c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2000-01-22 Richard M. Stallman <rms@caffeine.ai.mit.edu> | ||
| 2 | |||
| 3 | * replace.el (query-replace): Rename last arg to DELIMITED. | ||
| 4 | (map-query-replace-regexp, query-replace-regexp-eval): Likewise. | ||
| 5 | (query-replace-regexp): Likewise. | ||
| 6 | |||
| 1 | 2000-01-20 Richard M. Stallman <rms@caffeine.ai.mit.edu> | 7 | 2000-01-20 Richard M. Stallman <rms@caffeine.ai.mit.edu> |
| 2 | 8 | ||
| 3 | * subr.el (with-syntax-table): Use make-symbol, not gensym. | 9 | * subr.el (with-syntax-table): Use make-symbol, not gensym. |
diff --git a/lisp/replace.el b/lisp/replace.el index 76813d4e0bf..5ff9645aac6 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -68,7 +68,7 @@ strings or patterns." | |||
| 68 | query-replace-to-history-variable from t)) | 68 | query-replace-to-history-variable from t)) |
| 69 | (list from to current-prefix-arg))) | 69 | (list from to current-prefix-arg))) |
| 70 | 70 | ||
| 71 | (defun query-replace (from-string to-string &optional arg) | 71 | (defun query-replace (from-string to-string &optional delimited) |
| 72 | "Replace some occurrences of FROM-STRING with TO-STRING. | 72 | "Replace some occurrences of FROM-STRING with TO-STRING. |
| 73 | As each match is found, the user must type a character saying | 73 | As each match is found, the user must type a character saying |
| 74 | what to do with it. For directions, type \\[help-command] at that time. | 74 | what to do with it. For directions, type \\[help-command] at that time. |
| @@ -91,11 +91,11 @@ only matches surrounded by word boundaries. | |||
| 91 | 91 | ||
| 92 | To customize possible responses, change the \"bindings\" in `query-replace-map'." | 92 | To customize possible responses, change the \"bindings\" in `query-replace-map'." |
| 93 | (interactive (query-replace-read-args "Query replace" nil)) | 93 | (interactive (query-replace-read-args "Query replace" nil)) |
| 94 | (perform-replace from-string to-string t nil arg)) | 94 | (perform-replace from-string to-string t nil delimited)) |
| 95 | 95 | ||
| 96 | (define-key esc-map "%" 'query-replace) | 96 | (define-key esc-map "%" 'query-replace) |
| 97 | 97 | ||
| 98 | (defun query-replace-regexp (regexp to-string &optional arg) | 98 | (defun query-replace-regexp (regexp to-string &optional delimited) |
| 99 | "Replace some things after point matching REGEXP with TO-STRING. | 99 | "Replace some things after point matching REGEXP with TO-STRING. |
| 100 | As each match is found, the user must type a character saying | 100 | As each match is found, the user must type a character saying |
| 101 | what to do with it. For directions, type \\[help-command] at that time. | 101 | what to do with it. For directions, type \\[help-command] at that time. |
| @@ -115,10 +115,10 @@ In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, | |||
| 115 | and `\\=\\N' (where N is a digit) stands for | 115 | and `\\=\\N' (where N is a digit) stands for |
| 116 | whatever what matched the Nth `\\(...\\)' in REGEXP." | 116 | whatever what matched the Nth `\\(...\\)' in REGEXP." |
| 117 | (interactive (query-replace-read-args "Query replace regexp" t)) | 117 | (interactive (query-replace-read-args "Query replace regexp" t)) |
| 118 | (perform-replace regexp to-string t t arg)) | 118 | (perform-replace regexp to-string t t delimited)) |
| 119 | (define-key esc-map [?\C-%] 'query-replace-regexp) | 119 | (define-key esc-map [?\C-%] 'query-replace-regexp) |
| 120 | 120 | ||
| 121 | (defun query-replace-regexp-eval (regexp to-expr &optional arg) | 121 | (defun query-replace-regexp-eval (regexp to-expr &optional delimited) |
| 122 | "Replace some things after point matching REGEXP with the result of TO-EXPR. | 122 | "Replace some things after point matching REGEXP with the result of TO-EXPR. |
| 123 | As each match is found, the user must type a character saying | 123 | As each match is found, the user must type a character saying |
| 124 | what to do with it. For directions, type \\[help-command] at that time. | 124 | what to do with it. For directions, type \\[help-command] at that time. |
| @@ -159,9 +159,10 @@ only matches surrounded by word boundaries." | |||
| 159 | ;; and the user might enter a single token. | 159 | ;; and the user might enter a single token. |
| 160 | (replace-match-string-symbols to) | 160 | (replace-match-string-symbols to) |
| 161 | (list from (car to) current-prefix-arg))) | 161 | (list from (car to) current-prefix-arg))) |
| 162 | (perform-replace regexp (cons 'replace-eval-replacement to-expr) t t arg)) | 162 | (perform-replace regexp (cons 'replace-eval-replacement to-expr) |
| 163 | t t delimited)) | ||
| 163 | 164 | ||
| 164 | (defun map-query-replace-regexp (regexp to-strings &optional arg) | 165 | (defun map-query-replace-regexp (regexp to-strings &optional delimited) |
| 165 | "Replace some matches for REGEXP with various strings, in rotation. | 166 | "Replace some matches for REGEXP with various strings, in rotation. |
| 166 | The second argument TO-STRINGS contains the replacement strings, separated | 167 | The second argument TO-STRINGS contains the replacement strings, separated |
| 167 | by spaces. This command works like `query-replace-regexp' except | 168 | by spaces. This command works like `query-replace-regexp' except |
| @@ -204,7 +205,7 @@ before rotating to the next." | |||
| 204 | (1+ (string-match " " to-strings)))) | 205 | (1+ (string-match " " to-strings)))) |
| 205 | (setq replacements (append replacements (list to-strings)) | 206 | (setq replacements (append replacements (list to-strings)) |
| 206 | to-strings "")))) | 207 | to-strings "")))) |
| 207 | (perform-replace regexp replacements t t nil arg))) | 208 | (perform-replace regexp replacements t t nil delimited))) |
| 208 | 209 | ||
| 209 | (defun replace-string (from-string to-string &optional delimited) | 210 | (defun replace-string (from-string to-string &optional delimited) |
| 210 | "Replace occurrences of FROM-STRING with TO-STRING. | 211 | "Replace occurrences of FROM-STRING with TO-STRING. |