aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov2012-09-10 01:15:24 +0300
committerJuri Linkov2012-09-10 01:15:24 +0300
commit3231d532c7e6c3ed0a2e58574bec5518404a7f82 (patch)
tree6f95e4d2f705101d25e0a932d4639a4417617c52 /lisp/replace.el
parente7032e7c6ce273720267070e97fb5567a128fc1f (diff)
downloademacs-3231d532c7e6c3ed0a2e58574bec5518404a7f82.tar.gz
emacs-3231d532c7e6c3ed0a2e58574bec5518404a7f82.zip
* lisp/replace.el (replace-regexp-lax-whitespace): New defcustom.
(replace-lax-whitespace, query-replace-regexp) (query-replace-regexp-eval, replace-regexp): Doc fix. (perform-replace, replace-highlight): Let-bind isearch-lax-whitespace to replace-lax-whitespace and isearch-regexp-lax-whitespace to replace-regexp-lax-whitespace. * lisp/isearch.el (isearch-query-replace): Let-bind replace-lax-whitespace to isearch-lax-whitespace and replace-regexp-lax-whitespace to isearch-regexp-lax-whitespace. Fixes: debbugs:10885
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el24
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index b30b671122e..001f7d1a78d 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -35,7 +35,15 @@
35 35
36(defcustom replace-lax-whitespace nil 36(defcustom replace-lax-whitespace nil
37 "Non-nil means `query-replace' matches a sequence of whitespace chars. 37 "Non-nil means `query-replace' matches a sequence of whitespace chars.
38When you enter a space or spaces in the strings or regexps to be replaced, 38When you enter a space or spaces in the strings to be replaced,
39it will match any sequence matched by the regexp `search-whitespace-regexp'."
40 :type 'boolean
41 :group 'matching
42 :version "24.3")
43
44(defcustom replace-regexp-lax-whitespace nil
45 "Non-nil means `query-replace-regexp' matches a sequence of whitespace chars.
46When you enter a space or spaces in the regexps to be replaced,
39it will match any sequence matched by the regexp `search-whitespace-regexp'." 47it will match any sequence matched by the regexp `search-whitespace-regexp'."
40 :type 'boolean 48 :type 'boolean
41 :group 'matching 49 :group 'matching
@@ -282,7 +290,7 @@ pattern of the old text to the new text, if `case-replace' and
282all caps, or capitalized, then its replacement is upcased or 290all caps, or capitalized, then its replacement is upcased or
283capitalized.) 291capitalized.)
284 292
285If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp 293If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp
286to be replaced will match a sequence of whitespace chars defined by the 294to be replaced will match a sequence of whitespace chars defined by the
287regexp in `search-whitespace-regexp'. 295regexp in `search-whitespace-regexp'.
288 296
@@ -362,7 +370,7 @@ minibuffer.
362Preserves case in each replacement if `case-replace' and `case-fold-search' 370Preserves case in each replacement if `case-replace' and `case-fold-search'
363are non-nil and REGEXP has no uppercase letters. 371are non-nil and REGEXP has no uppercase letters.
364 372
365If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp 373If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp
366to be replaced will match a sequence of whitespace chars defined by the 374to be replaced will match a sequence of whitespace chars defined by the
367regexp in `search-whitespace-regexp'. 375regexp in `search-whitespace-regexp'.
368 376
@@ -499,7 +507,7 @@ and TO-STRING is also null.)"
499Preserve case in each match if `case-replace' and `case-fold-search' 507Preserve case in each match if `case-replace' and `case-fold-search'
500are non-nil and REGEXP has no uppercase letters. 508are non-nil and REGEXP has no uppercase letters.
501 509
502If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp 510If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp
503to be replaced will match a sequence of whitespace chars defined by the 511to be replaced will match a sequence of whitespace chars defined by the
504regexp in `search-whitespace-regexp'. 512regexp in `search-whitespace-regexp'.
505 513
@@ -1803,9 +1811,9 @@ make, or the user didn't cancel the call."
1803 (let ((isearch-regexp regexp-flag) 1811 (let ((isearch-regexp regexp-flag)
1804 (isearch-word delimited-flag) 1812 (isearch-word delimited-flag)
1805 (isearch-lax-whitespace 1813 (isearch-lax-whitespace
1806 (and replace-lax-whitespace (not regexp-flag))) 1814 replace-lax-whitespace)
1807 (isearch-regexp-lax-whitespace 1815 (isearch-regexp-lax-whitespace
1808 (and replace-lax-whitespace regexp-flag)) 1816 replace-regexp-lax-whitespace)
1809 (isearch-case-fold-search case-fold-search) 1817 (isearch-case-fold-search case-fold-search)
1810 (isearch-forward t)) 1818 (isearch-forward t))
1811 (isearch-search-fun)))) 1819 (isearch-search-fun))))
@@ -2160,9 +2168,9 @@ make, or the user didn't cancel the call."
2160 (isearch-regexp regexp-flag) 2168 (isearch-regexp regexp-flag)
2161 (isearch-word delimited-flag) 2169 (isearch-word delimited-flag)
2162 (isearch-lax-whitespace 2170 (isearch-lax-whitespace
2163 (and replace-lax-whitespace (not regexp-flag))) 2171 replace-lax-whitespace)
2164 (isearch-regexp-lax-whitespace 2172 (isearch-regexp-lax-whitespace
2165 (and replace-lax-whitespace regexp-flag)) 2173 replace-regexp-lax-whitespace)
2166 (isearch-case-fold-search case-fold-search) 2174 (isearch-case-fold-search case-fold-search)
2167 (isearch-forward t) 2175 (isearch-forward t)
2168 (isearch-error nil)) 2176 (isearch-error nil))