diff options
author | Juri Linkov <juri@jurta.org> | 2012-09-10 01:15:24 +0300 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2012-09-10 01:15:24 +0300 |
commit | 3231d532c7e6c3ed0a2e58574bec5518404a7f82 (patch) | |
tree | 6f95e4d2f705101d25e0a932d4639a4417617c52 /lisp/replace.el | |
parent | e7032e7c6ce273720267070e97fb5567a128fc1f (diff) | |
download | emacs-3231d532c7e6c3ed0a2e58574bec5518404a7f82.tar.gz |
* 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 @@ (defcustom replace-lax-whitespace nil "Non-nil means `query-replace' matches a sequence of whitespace chars. -When you enter a space or spaces in the strings or regexps to be replaced, +When you enter a space or spaces in the strings to be replaced, +it will match any sequence matched by the regexp `search-whitespace-regexp'." + :type 'boolean + :group 'matching + :version "24.3") + +(defcustom replace-regexp-lax-whitespace nil + "Non-nil means `query-replace-regexp' matches a sequence of whitespace chars. +When you enter a space or spaces in the regexps to be replaced, it will match any sequence matched by the regexp `search-whitespace-regexp'." :type 'boolean :group 'matching @@ -282,7 +290,7 @@ pattern of the old text to the new text, if `case-replace' and all caps, or capitalized, then its replacement is upcased or capitalized.) -If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp +If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. @@ -362,7 +370,7 @@ minibuffer. Preserves case in each replacement if `case-replace' and `case-fold-search' are non-nil and REGEXP has no uppercase letters. -If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp +If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. @@ -499,7 +507,7 @@ and TO-STRING is also null.)" Preserve case in each match if `case-replace' and `case-fold-search' are non-nil and REGEXP has no uppercase letters. -If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp +If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. @@ -1803,9 +1811,9 @@ make, or the user didn't cancel the call." (let ((isearch-regexp regexp-flag) (isearch-word delimited-flag) (isearch-lax-whitespace - (and replace-lax-whitespace (not regexp-flag))) + replace-lax-whitespace) (isearch-regexp-lax-whitespace - (and replace-lax-whitespace regexp-flag)) + replace-regexp-lax-whitespace) (isearch-case-fold-search case-fold-search) (isearch-forward t)) (isearch-search-fun)))) @@ -2160,9 +2168,9 @@ make, or the user didn't cancel the call." (isearch-regexp regexp-flag) (isearch-word delimited-flag) (isearch-lax-whitespace - (and replace-lax-whitespace (not regexp-flag))) + replace-lax-whitespace) (isearch-regexp-lax-whitespace - (and replace-lax-whitespace regexp-flag)) + replace-regexp-lax-whitespace) (isearch-case-fold-search case-fold-search) (isearch-forward t) (isearch-error nil)) |