Subject: Re: bug#10885: Replace expressions: enhance functionality when searching in filled paragraphs

From: Kevin Rodgers <[email-masked]>
Date: Sun, 26 Feb 2012 00:16:36 -0700

On 2/25/12 6:57 PM, Glenn Morris wrote:
> linuxfever wrote:
>
>> Currently it seems that when trying to replace an expression comprising two
>> words, say for example 'replace this', then the functions 'replace-string'
>> or 'replace-regexp' fail to locate the expression when that is split along
>> two lines in the text, i.e., in the above example when the word 'replace' is
>> at the end of one line, and the word 'this' is at the beginning of the next
>> one.
>
> You can use query-replace-regexp for this.
>
> Sample input:
>
> This is text. This is text. This is text. This is text. Replace this.
> This is text. This is text. This is text. This is text. This is text. Replace
> this.
> Replace                    this.
>
> M-x query-replace-regexp RET \(replace\)\([ ^I^J]*\)\(this\) RET Done\2that RET
>
> Output:
>
> This is text. This is text. This is text. This is text. Done that.
> This is text. This is text. This is text. This is text. This is text. Done
> that.
> Done                    that.

Would it make sense for replace-regexp/query-replace-regexp (and other commands
that read regexps from the user) to respect search-whitespace-regexp, just like
isearch?

-- 
Kevin Rodgers
Denver, Colorado, USA