From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Advanced query-replace-regexp in code Date: Thu, 28 May 2009 22:14:02 -0400 Organization: A noiseless patient Spider Message-ID: References: <878wkhakp1.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1243564842 24036 80.91.229.12 (29 May 2009 02:40:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 May 2009 02:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 29 04:40:40 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 1M9s1Q-0007oV-75 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 May 2009 04:40:40 +0200 Original-Received: from localhost ([127.0.0.1]:45706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9s1P-000328-IC for geh-help-gnu-emacs@m.gmane.org; Thu, 28 May 2009 22:40:39 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!weretis.net!feeder2.news.weretis.net!feeder.motzarella.org!news.motzarella.org!news.eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: news.eternal-september.org U2FsdGVkX18ytqUNUVMs4uAAIBxOPGoFiES7pXkD8y3BaTMgwyPDit4dq4XLt5aTGIoE2qKOu15oNgDHaoaDYD34bDxFSl5sB5xxU5DkCFfelBl/B9dOBfjaSzll3EOXURrtuQYQRLm52pJkgVu25Q== Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Fri, 29 May 2009 02:14:02 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+F64kLeMh/jhRqck2q08zZZzRSxjefDso= Cancel-Lock: sha1:upqApmGWmNbKVJaQldS049wGWbE= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:169575 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:64807 Archived-At: In article , bojohan+news@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: > > This function is usually the wrong thing to use in a Lisp program. > What you probably want is a loop like this: > (while (re-search-forward REGEXP nil t) > (replace-match TO-STRING nil nil)) > which will run faster and will not set the mark or print anything. 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. If it shouldn't be used programmatically, why is it important that this mode *not* recognize \,? -- Barry Margolin, barmar@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 ***