diff options
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/replace.el | 51 |
2 files changed, 37 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1614c1db2a..97893e936e0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | 2008-10-19 Juri Linkov <juri@jurta.org> | 1 | 2008-10-19 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * isearch.el (isearch-query-replace, isearch-query-replace-regexp): | ||
| 4 | Add arg `delimited' as in `query-replace' for the case when | ||
| 5 | isearch-allow-scroll=t and the user types C-u M-%. Doc fix. | ||
| 6 | Add more indicators to the prompt ("word" and "in region"). | ||
| 7 | |||
| 8 | * replace.el (query-replace, query-replace-regexp) | ||
| 9 | (replace-string, replace-regexp, perform-replace): Add "word" | ||
| 10 | indicatiors to the prompt for word delimited replacements. | ||
| 11 | |||
| 3 | * replace.el (read-regexp): Rename arg `default' to `default-value'. | 12 | * replace.el (read-regexp): Rename arg `default' to `default-value'. |
| 4 | Doc fix. | 13 | Doc fix. |
| 5 | 14 | ||
diff --git a/lisp/replace.el b/lisp/replace.el index c2256ab5f54..e54939ff8dc 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -223,20 +223,21 @@ only matches surrounded by word boundaries. | |||
| 223 | Fourth and fifth arg START and END specify the region to operate on. | 223 | Fourth and fifth arg START and END specify the region to operate on. |
| 224 | 224 | ||
| 225 | To customize possible responses, change the \"bindings\" in `query-replace-map'." | 225 | To customize possible responses, change the \"bindings\" in `query-replace-map'." |
| 226 | (interactive (let ((common | 226 | (interactive |
| 227 | (query-replace-read-args | 227 | (let ((common |
| 228 | (if (and transient-mark-mode mark-active) | 228 | (query-replace-read-args |
| 229 | "Query replace in region" | 229 | (concat "Query replace" |
| 230 | "Query replace") | 230 | (if current-prefix-arg " word" "") |
| 231 | nil))) | 231 | (if (and transient-mark-mode mark-active) " in region" "")) |
| 232 | (list (nth 0 common) (nth 1 common) (nth 2 common) | 232 | nil))) |
| 233 | ;; These are done separately here | 233 | (list (nth 0 common) (nth 1 common) (nth 2 common) |
| 234 | ;; so that command-history will record these expressions | 234 | ;; These are done separately here |
| 235 | ;; rather than the values they had this time. | 235 | ;; so that command-history will record these expressions |
| 236 | (if (and transient-mark-mode mark-active) | 236 | ;; rather than the values they had this time. |
| 237 | (region-beginning)) | 237 | (if (and transient-mark-mode mark-active) |
| 238 | (if (and transient-mark-mode mark-active) | 238 | (region-beginning)) |
| 239 | (region-end))))) | 239 | (if (and transient-mark-mode mark-active) |
| 240 | (region-end))))) | ||
| 240 | (perform-replace from-string to-string t nil delimited nil nil start end)) | 241 | (perform-replace from-string to-string t nil delimited nil nil start end)) |
| 241 | 242 | ||
| 242 | (define-key esc-map "%" 'query-replace) | 243 | (define-key esc-map "%" 'query-replace) |
| @@ -289,9 +290,10 @@ Use \\[repeat-complex-command] after this command for details." | |||
| 289 | (interactive | 290 | (interactive |
| 290 | (let ((common | 291 | (let ((common |
| 291 | (query-replace-read-args | 292 | (query-replace-read-args |
| 292 | (if (and transient-mark-mode mark-active) | 293 | (concat "Query replace" |
| 293 | "Query replace regexp in region" | 294 | (if current-prefix-arg " word" "") |
| 294 | "Query replace regexp") | 295 | " regexp" |
| 296 | (if (and transient-mark-mode mark-active) " in region" "")) | ||
| 295 | t))) | 297 | t))) |
| 296 | (list (nth 0 common) (nth 1 common) (nth 2 common) | 298 | (list (nth 0 common) (nth 1 common) (nth 2 common) |
| 297 | ;; These are done separately here | 299 | ;; These are done separately here |
| @@ -447,9 +449,10 @@ and TO-STRING is also null.)" | |||
| 447 | (interactive | 449 | (interactive |
| 448 | (let ((common | 450 | (let ((common |
| 449 | (query-replace-read-args | 451 | (query-replace-read-args |
| 450 | (if (and transient-mark-mode mark-active) | 452 | (concat "Replace" |
| 451 | "Replace string in region" | 453 | (if current-prefix-arg " word" "") |
| 452 | "Replace string") | 454 | " string" |
| 455 | (if (and transient-mark-mode mark-active) " in region" "")) | ||
| 453 | nil))) | 456 | nil))) |
| 454 | (list (nth 0 common) (nth 1 common) (nth 2 common) | 457 | (list (nth 0 common) (nth 1 common) (nth 2 common) |
| 455 | (if (and transient-mark-mode mark-active) | 458 | (if (and transient-mark-mode mark-active) |
| @@ -504,9 +507,10 @@ which will run faster and will not set the mark or print anything." | |||
| 504 | (interactive | 507 | (interactive |
| 505 | (let ((common | 508 | (let ((common |
| 506 | (query-replace-read-args | 509 | (query-replace-read-args |
| 507 | (if (and transient-mark-mode mark-active) | 510 | (concat "Replace" |
| 508 | "Replace regexp in region" | 511 | (if current-prefix-arg " word" "") |
| 509 | "Replace regexp") | 512 | " regexp" |
| 513 | (if (and transient-mark-mode mark-active) " in region" "")) | ||
| 510 | t))) | 514 | t))) |
| 511 | (list (nth 0 common) (nth 1 common) (nth 2 common) | 515 | (list (nth 0 common) (nth 1 common) (nth 2 common) |
| 512 | (if (and transient-mark-mode mark-active) | 516 | (if (and transient-mark-mode mark-active) |
| @@ -1716,6 +1720,7 @@ make, or the user didn't cancel the call." | |||
| 1716 | (with-output-to-temp-buffer "*Help*" | 1720 | (with-output-to-temp-buffer "*Help*" |
| 1717 | (princ | 1721 | (princ |
| 1718 | (concat "Query replacing " | 1722 | (concat "Query replacing " |
| 1723 | (if delimited-flag "word " "") | ||
| 1719 | (if regexp-flag "regexp " "") | 1724 | (if regexp-flag "regexp " "") |
| 1720 | from-string " with " | 1725 | from-string " with " |
| 1721 | next-replacement ".\n\n" | 1726 | next-replacement ".\n\n" |