From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: Advanced query-replace-regexp in code Date: Sun, 02 Aug 2009 18:19:32 +0200 Organization: Organization?!? Message-ID: <877hxm89yj.fsf@lola.goethe.zz> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1249231309 2857 80.91.229.12 (2 Aug 2009 16:41:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2009 16:41:49 +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 Aug 02 18:41:43 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 1MXe79-0003zc-8g for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Aug 2009 18:40:51 +0200 Original-Received: from localhost ([127.0.0.1]:39465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXe78-0004Cj-GE for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Aug 2009 12:40:50 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!news2.euro.net!feeder.news-service.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:wjOEG4aLYISgeYJgg7d6i5gs7gc= Original-Lines: 20 Original-NNTP-Posting-Date: 02 Aug 2009 18:19:32 CEST Original-NNTP-Posting-Host: 776ec237.newsspool3.arcor-online.net Original-X-Trace: DXC=0S@:OPnPF[?^8FBo0_81f>McF=Q^Z^V384Fo<]lROoR1^YC2XCjHcb9Q:Qai; CV`H8_`hhQ4^9QSCVg3dO6gcO2@_RHd:4\^kGZ\X@MC>X\:79kjIA2= Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: news.stanford.edu gnu.emacs.help:171478 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:66661 Archived-At: Nordlöw writes: > 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. Do it interactively, then use C-x ESC ESC in order to figure out how to this non-interactively. -- David Kastrup