diff options
| author | Juri Linkov | 2012-09-10 01:15:24 +0300 |
|---|---|---|
| committer | Juri Linkov | 2012-09-10 01:15:24 +0300 |
| commit | 3231d532c7e6c3ed0a2e58574bec5518404a7f82 (patch) | |
| tree | 6f95e4d2f705101d25e0a932d4639a4417617c52 /lisp/replace.el | |
| parent | e7032e7c6ce273720267070e97fb5567a128fc1f (diff) | |
| download | emacs-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.el | 24 |
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. |
| 38 | When you enter a space or spaces in the strings or regexps to be replaced, | 38 | When you enter a space or spaces in the strings to be replaced, |
| 39 | it 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. | ||
| 46 | When you enter a space or spaces in the regexps to be replaced, | ||
| 39 | it will match any sequence matched by the regexp `search-whitespace-regexp'." | 47 | it 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 | |||
| 282 | all caps, or capitalized, then its replacement is upcased or | 290 | all caps, or capitalized, then its replacement is upcased or |
| 283 | capitalized.) | 291 | capitalized.) |
| 284 | 292 | ||
| 285 | If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp | 293 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp |
| 286 | to be replaced will match a sequence of whitespace chars defined by the | 294 | to be replaced will match a sequence of whitespace chars defined by the |
| 287 | regexp in `search-whitespace-regexp'. | 295 | regexp in `search-whitespace-regexp'. |
| 288 | 296 | ||
| @@ -362,7 +370,7 @@ minibuffer. | |||
| 362 | Preserves case in each replacement if `case-replace' and `case-fold-search' | 370 | Preserves case in each replacement if `case-replace' and `case-fold-search' |
| 363 | are non-nil and REGEXP has no uppercase letters. | 371 | are non-nil and REGEXP has no uppercase letters. |
| 364 | 372 | ||
| 365 | If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp | 373 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp |
| 366 | to be replaced will match a sequence of whitespace chars defined by the | 374 | to be replaced will match a sequence of whitespace chars defined by the |
| 367 | regexp in `search-whitespace-regexp'. | 375 | regexp in `search-whitespace-regexp'. |
| 368 | 376 | ||
| @@ -499,7 +507,7 @@ and TO-STRING is also null.)" | |||
| 499 | Preserve case in each match if `case-replace' and `case-fold-search' | 507 | Preserve case in each match if `case-replace' and `case-fold-search' |
| 500 | are non-nil and REGEXP has no uppercase letters. | 508 | are non-nil and REGEXP has no uppercase letters. |
| 501 | 509 | ||
| 502 | If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp | 510 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp |
| 503 | to be replaced will match a sequence of whitespace chars defined by the | 511 | to be replaced will match a sequence of whitespace chars defined by the |
| 504 | regexp in `search-whitespace-regexp'. | 512 | regexp 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)) |