From: Juri Linkov Date: Sun, 19 Oct 2008 22:34:35 +0000 (+0000) Subject: (query-replace, query-replace-regexp) X-Git-Tag: emacs-pretest-23.0.90~2351 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=04ff2deeb32c2a986531cc4b24dd3ef26a6a3000;p=emacs.git (query-replace, query-replace-regexp) (replace-string, replace-regexp, perform-replace): Add "word" indicatiors to the prompt for word delimited replacements. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1614c1db2a..97893e936e0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,14 @@ 2008-10-19 Juri Linkov + * isearch.el (isearch-query-replace, isearch-query-replace-regexp): + Add arg `delimited' as in `query-replace' for the case when + isearch-allow-scroll=t and the user types C-u M-%. Doc fix. + Add more indicators to the prompt ("word" and "in region"). + + * replace.el (query-replace, query-replace-regexp) + (replace-string, replace-regexp, perform-replace): Add "word" + indicatiors to the prompt for word delimited replacements. + * replace.el (read-regexp): Rename arg `default' to `default-value'. Doc fix. 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. Fourth and fifth arg START and END specify the region to operate on. To customize possible responses, change the \"bindings\" in `query-replace-map'." - (interactive (let ((common - (query-replace-read-args - (if (and transient-mark-mode mark-active) - "Query replace in region" - "Query replace") - nil))) - (list (nth 0 common) (nth 1 common) (nth 2 common) - ;; These are done separately here - ;; so that command-history will record these expressions - ;; rather than the values they had this time. - (if (and transient-mark-mode mark-active) - (region-beginning)) - (if (and transient-mark-mode mark-active) - (region-end))))) + (interactive + (let ((common + (query-replace-read-args + (concat "Query replace" + (if current-prefix-arg " word" "") + (if (and transient-mark-mode mark-active) " in region" "")) + nil))) + (list (nth 0 common) (nth 1 common) (nth 2 common) + ;; These are done separately here + ;; so that command-history will record these expressions + ;; rather than the values they had this time. + (if (and transient-mark-mode mark-active) + (region-beginning)) + (if (and transient-mark-mode mark-active) + (region-end))))) (perform-replace from-string to-string t nil delimited nil nil start end)) (define-key esc-map "%" 'query-replace) @@ -289,9 +290,10 @@ Use \\[repeat-complex-command] after this command for details." (interactive (let ((common (query-replace-read-args - (if (and transient-mark-mode mark-active) - "Query replace regexp in region" - "Query replace regexp") + (concat "Query replace" + (if current-prefix-arg " word" "") + " regexp" + (if (and transient-mark-mode mark-active) " in region" "")) t))) (list (nth 0 common) (nth 1 common) (nth 2 common) ;; These are done separately here @@ -447,9 +449,10 @@ and TO-STRING is also null.)" (interactive (let ((common (query-replace-read-args - (if (and transient-mark-mode mark-active) - "Replace string in region" - "Replace string") + (concat "Replace" + (if current-prefix-arg " word" "") + " string" + (if (and transient-mark-mode mark-active) " in region" "")) nil))) (list (nth 0 common) (nth 1 common) (nth 2 common) (if (and transient-mark-mode mark-active) @@ -504,9 +507,10 @@ which will run faster and will not set the mark or print anything." (interactive (let ((common (query-replace-read-args - (if (and transient-mark-mode mark-active) - "Replace regexp in region" - "Replace regexp") + (concat "Replace" + (if current-prefix-arg " word" "") + " regexp" + (if (and transient-mark-mode mark-active) " in region" "")) t))) (list (nth 0 common) (nth 1 common) (nth 2 common) (if (and transient-mark-mode mark-active) @@ -1716,6 +1720,7 @@ make, or the user didn't cancel the call." (with-output-to-temp-buffer "*Help*" (princ (concat "Query replacing " + (if delimited-flag "word " "") (if regexp-flag "regexp " "") from-string " with " next-replacement ".\n\n"