From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Nordl=F6w?= Newsgroups: gmane.emacs.help Subject: Re: Advanced query-replace-regexp in code Date: Fri, 29 May 2009 23:34:45 -0700 (PDT) Organization: http://groups.google.com Message-ID: <6bd73a11-87c9-4614-a93a-5c5c9f4bc181@z14g2000yqa.googlegroups.com> References: <878wkhakp1.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1243665648 10599 80.91.229.12 (30 May 2009 06:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 May 2009 06:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 30 08:40:46 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MAIFK-0001QS-Am for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2009 08:40:46 +0200 Original-Received: from localhost ([127.0.0.1]:35015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MAIFJ-0007hV-Kl for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2009 02:40:45 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z14g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 81.170.250.228 Original-X-Trace: posting.google.com 1243665285 19827 127.0.0.1 (30 May 2009 06:34:45 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 30 May 2009 06:34:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z14g2000yqa.googlegroups.com; posting-host=81.170.250.228; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1pre) Gecko/20090526 Ubuntu/9.04 (jaunty) Shiretoko/3.5pre, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:169594 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:64825 Archived-At: On May 29, 4:14=A0am, Barry Margolin wrote: > In article , > =A0bojohan+n...@dd.chalmers.se (Johan Bockgard) wrote: > > > Barry Margolin writes: > > > > In that case, why allow programs to call replace-regexp in the first > > > place? If they can call it, why shouldn't they be able to use all the > > > features? > > > They shouldn't call it: > > > =A0 =A0 This function is usually the wrong thing to use in a Lisp progr= am. > > =A0 =A0 What you probably want is a loop like this: > > =A0 =A0 =A0 (while (re-search-forward REGEXP nil t) > > =A0 =A0 =A0 =A0 (replace-match TO-STRING nil nil)) > > =A0 =A0 which will run faster and will not set the mark or print anythi= ng. > > Regardless of whether they should or shouldn't use it, it still seems > strange that the function interprets the second argument differently > depending on whether it's use interactively or programmatically. =A0If it > shouldn't be used programmatically, why is it important that this mode > *not* recognize \,? > > -- > Barry Margolin, bar...@alum.mit.edu > Arlington, MA > *** PLEASE post questions in newsgroups, not directly to me *** > *** PLEASE don't copy me on replies, I'll read them in the group *** I agree, this makes no sense as this is powerful feature, eventhough it runs slowly. /Nordl=F6w