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 | |
| 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
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/isearch.el | 7 | ||||
| -rw-r--r-- | lisp/replace.el | 24 |
3 files changed, 33 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f46fbdcc9ed..6ec52876d49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2012-09-09 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * replace.el (replace-regexp-lax-whitespace): New defcustom. | ||
| 4 | (replace-lax-whitespace, query-replace-regexp) | ||
| 5 | (query-replace-regexp-eval, replace-regexp): Doc fix. | ||
| 6 | (perform-replace, replace-highlight): Let-bind | ||
| 7 | isearch-lax-whitespace to replace-lax-whitespace and | ||
| 8 | isearch-regexp-lax-whitespace to replace-regexp-lax-whitespace. | ||
| 9 | |||
| 10 | * isearch.el (isearch-query-replace): Let-bind | ||
| 11 | replace-lax-whitespace to isearch-lax-whitespace and | ||
| 12 | replace-regexp-lax-whitespace to | ||
| 13 | isearch-regexp-lax-whitespace. (Bug#10885) | ||
| 14 | |||
| 1 | 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca> | 15 | 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 16 | ||
| 3 | * eshell/em-unix.el (eshell/sudo): Explicitly drop return value. | 17 | * eshell/em-unix.el (eshell/sudo): Explicitly drop return value. |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 328e4eb447f..04f5a7acc2c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1581,10 +1581,9 @@ way to run word replacements from Isearch is `M-s w ... M-%'." | |||
| 1581 | ;; `isearch-no-upper-case-p' in `perform-replace' | 1581 | ;; `isearch-no-upper-case-p' in `perform-replace' |
| 1582 | (search-upper-case nil) | 1582 | (search-upper-case nil) |
| 1583 | (replace-lax-whitespace | 1583 | (replace-lax-whitespace |
| 1584 | (and search-whitespace-regexp | 1584 | isearch-lax-whitespace) |
| 1585 | (if isearch-regexp | 1585 | (replace-regexp-lax-whitespace |
| 1586 | isearch-regexp-lax-whitespace | 1586 | isearch-regexp-lax-whitespace) |
| 1587 | isearch-lax-whitespace))) | ||
| 1588 | ;; Set `isearch-recursive-edit' to nil to prevent calling | 1587 | ;; Set `isearch-recursive-edit' to nil to prevent calling |
| 1589 | ;; `exit-recursive-edit' in `isearch-done' that terminates | 1588 | ;; `exit-recursive-edit' in `isearch-done' that terminates |
| 1590 | ;; the execution of this command when it is non-nil. | 1589 | ;; the execution of this command when it is non-nil. |
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)) |