From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: search across linebreaks Date: Sun, 17 Feb 2013 15:43:53 +0800 Message-ID: <878v6nbd1i.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361097799 28047 80.91.229.3 (17 Feb 2013 10:43:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Feb 2013 10:43:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 17 11:43:38 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U71ia-0004ix-Qs for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Feb 2013 11:43:36 +0100 Original-Received: from localhost ([::1]:35562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U71iF-0002qv-Ts for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Feb 2013 05:43:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U71i6-0002pi-FZ for help-gnu-emacs@gnu.org; Sun, 17 Feb 2013 05:43:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U71i1-0003VU-Hg for help-gnu-emacs@gnu.org; Sun, 17 Feb 2013 05:43:06 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:40896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6ypj-0002tl-Dm for help-gnu-emacs@gnu.org; Sun, 17 Feb 2013 02:38:47 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U6ypy-0006dd-RL for help-gnu-emacs@gnu.org; Sun, 17 Feb 2013 08:39:02 +0100 Original-Received: from 114.250.105.255 ([114.250.105.255]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Feb 2013 08:39:02 +0100 Original-Received: from eric by 114.250.105.255 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Feb 2013 08:39:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114.250.105.255 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:AHhpJP4vOJBRMPNVpM8GlTrtKzo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89128 Archived-At: 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