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: Advanced query-replace-regexp in code Date: Wed, 27 May 2009 07:03:02 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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 1243435565 16346 80.91.229.12 (27 May 2009 14:46:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 May 2009 14:46:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 27 16:46:03 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 1M9KOI-0003q3-OL for geh-help-gnu-emacs@m.gmane.org; Wed, 27 May 2009 16:46:02 +0200 Original-Received: from localhost ([127.0.0.1]:56218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9KOI-00062Y-1j for geh-help-gnu-emacs@m.gmane.org; Wed, 27 May 2009 10:46:02 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!e20g2000vbc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 12 Original-NNTP-Posting-Host: 81.170.250.228 Original-X-Trace: posting.google.com 1243432982 21813 127.0.0.1 (27 May 2009 14:03:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 27 May 2009 14:03:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e20g2000vbc.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/20090523 Ubuntu/9.04 (jaunty) Shiretoko/3.5pre, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:169538 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:64773 Archived-At: I can't get the following example to work programmatically. M-x replace-regexp Replace regexp: \(\w+\) Replace regexp with: \,(capitalize \1) Is this only possible in interactive query-replace? If so should I use a combination of while(), looking-at(), re-search- forward(), replace-match(), match-string() etc. Thanks in advance, Per Nordl=F6w