bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10885: Replace expressions: enhance functionality when searching in


From: Kevin Rodgers
Subject: bug#10885: Replace expressions: enhance functionality when searching in filled paragraphs
Date: Sun, 26 Feb 2012 00:16:36 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]