From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: C K Kashyap Newsgroups: gmane.emacs.help Subject: Re: String replace with lisp code Date: Mon, 18 Jul 2011 13:37:31 +0530 Message-ID: References: <4E23CF23.4050908@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00151744825cb7dc3f04a8537d59 X-Trace: dough.gmane.org 1310976581 18798 80.91.229.12 (18 Jul 2011 08:09:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 08:09:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 18 10:09:37 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QiitU-0002Bp-P7 for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2011 10:09:36 +0200 Original-Received: from localhost ([::1]:40026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiitT-000562-2Q for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2011 04:09:35 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiirX-000556-7p for help-gnu-emacs@gnu.org; Mon, 18 Jul 2011 04:07:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QiirV-0008GT-9f for help-gnu-emacs@gnu.org; Mon, 18 Jul 2011 04:07:35 -0400 Original-Received: from mail-fx0-f52.google.com ([209.85.161.52]:59612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiirU-0008G8-Rs for help-gnu-emacs@gnu.org; Mon, 18 Jul 2011 04:07:33 -0400 Original-Received: by fxd18 with SMTP id 18so5042648fxd.39 for ; Mon, 18 Jul 2011 01:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1QsCjw4WO6DWepulP1zID06utftgtaJSWiDZo1uxQMI=; b=MGhWUNSCgyWFfHRArg+R5eyz5bOe8h5zkyWWILyIhuqN5R7q/3A/81sflWBIS8/CNT Y91Op1DKmWe4G9vjGLd/PJea/2KY8WwRKzmQiteWugu+bBCOmlTRBkg8ky8uGmrKQ1RX 0LYP3lFzMtemB3/5UCb4XMyGqoe/VmIp1PEfo= Original-Received: by 10.223.54.90 with SMTP id p26mr9817903fag.44.1310976451795; Mon, 18 Jul 2011 01:07:31 -0700 (PDT) Original-Received: by 10.223.120.74 with HTTP; Mon, 18 Jul 2011 01:07:31 -0700 (PDT) In-Reply-To: <4E23CF23.4050908@easy-emacs.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.52 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81646 Archived-At: --00151744825cb7dc3f04a8537d59 Content-Type: text/plain; charset=ISO-8859-1 > > > M-x query-replace-regexp, > \(sea\) > RET > \,(progn (or count (setq count 1))(setq count (1+ count))(concat "(" > (number-to-string count) ")" \1)) > RET > > ;;;;;;;;;;;; > > \,EXPR > > evaluates the expression and the takes the result for replacement. > > > Andreas > > -- > https://launchpad.net/python-**mode > https://launchpad.net/s-x-**emacs-werkstatt/ > > > Thank you very much Teemu and Andreas! Regards, Kashyap --00151744825cb7dc3f04a8537d59 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

M-x query-replace-regexp,
\(sea\)
RET
\,(progn (or count (setq count 1))(setq count (1+ count))(concat "(&qu= ot; (number-to-string count) ")" \1))
RET

;;;;;;;;;;;;

\,EXPR

evaluates the expression and the takes the result for replacement.


Andreas

--
https://lau= nchpad.net/python-mode
ht= tps://launchpad.net/s-x-emacs-werkstatt/



Thank you very much Teemu and A= ndreas!
Regards,
Kashyap=A0

--00151744825cb7dc3f04a8537d59--