From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.help Subject: Re: query-replace Date: Sat, 06 May 2006 09:40:26 +0900 Message-ID: <87d5esvvd1.fsf@catnip.gol.com> References: <87bqudhsox.fsf@ulm.malte.spiess> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146876084 23945 80.91.229.2 (6 May 2006 00:41:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 May 2006 00:41:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 06 02:41:22 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FcArG-0002zD-6J for geh-help-gnu-emacs@m.gmane.org; Sat, 06 May 2006 02:41:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FcArF-0006O2-D3 for geh-help-gnu-emacs@m.gmane.org; Fri, 05 May 2006 20:41:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FcAqa-00065M-2P for help-gnu-emacs@gnu.org; Fri, 05 May 2006 20:40:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FcAqX-00063k-MV for help-gnu-emacs@gnu.org; Fri, 05 May 2006 20:40:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FcAqX-00063g-Gh for help-gnu-emacs@gnu.org; Fri, 05 May 2006 20:40:33 -0400 Original-Received: from [203.216.5.72] (helo=smtp02.dentaku.gol.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FcAql-00058B-Ql; Fri, 05 May 2006 20:40:48 -0400 Original-Received: from 203-216-102-135.dsl.gol.ne.jp ([203.216.102.135] helo=catnip.gol.com) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1FcAqS-0000Rw-FD; Sat, 06 May 2006 09:40:28 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 95DA52F56; Sat, 6 May 2006 09:40:26 +0900 (JST) Original-To: help-gnu-emacs@gnu.org System-Type: i686-pc-linux-gnu In-Reply-To: (Kevin Rodgers's message of "Fri, 05 May 2006 11:11:48 -0600") Original-Lines: 18 X-Abuse-Complaints: abuse@gol.com X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34865 Archived-At: Kevin Rodgers writes: >> Even simpler is M-% _and_ RET _or_ (where the underscores represent >> explicit spaces typed into the pattern strings. > > Which doesn't work if "and" occurs at the beginning or end of a line. Actually, the simplest way is to just use a `C-u' prefix to the replace or query-replace command -- it causes the replacements only be done on "word delimited" matches. So: C-u M-% and RET or RET (no significant spaces) -Miles -- "Suppose we've chosen the wrong god. Every time we go to church we're just making him madder and madder." -- Homer Simpson