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

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

search across linebreaks


From: Eric Abrahamsen
Subject: search across linebreaks
Date: Sun, 17 Feb 2013 15:43:53 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux)

I'm going to need to do a large scale search-and-replace on a series of
text files, using a sort of dictionary or hash-table of search terms and
their replacement. The text files are filled to the usual fill column.
The search terms may be broken across linebreaks, and I'm not sure of
the best way to handle this. If it was regular English words I could
probably manage a programmatic version of `isearch-toggle-word', but in
this case these are solid strings, and might be broken anywhere.

The two solutions I can think of are: 1) break up the characters in the
search string and insert "\n?" between each one to create regexps to
search on, and 2) unfill the whole file at the start of the procedure
and then refill it afterwards. Neither of these seems like a great
idea -- does anyone have any brighter ideas?

Thanks,
Eric




reply via email to

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