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: replace-regexp question Date: Wed, 26 Oct 2005 19:34:11 +0200 Organization: Organization?!? Message-ID: <85d5lsji7g.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1130348396 24138 80.91.229.2 (26 Oct 2005 17:39:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Oct 2005 17:39:56 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 26 19:39:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EUpBN-0007rA-O4 for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Oct 2005 19:35:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EUpBN-0001OK-5d for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Oct 2005 13:35:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!proxad.net!newsfeed.arcor.de!news.arcor.de!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.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:JjassqqhR8m61GJqwkSfaKTGKTM= Original-Lines: 19 Original-NNTP-Posting-Date: 26 Oct 2005 19:34:11 MEST Original-NNTP-Posting-Host: 3578a107.newsread4.arcor-online.net Original-X-Trace: DXC=TY\ggX8Gmb`a1IKbSTkC[i:ejgIfPPlddjW\KbG]kaMh:YeUX299h1lV5MOK`jbWoWITGh6mh Original-X-Complaints-To: abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:135000 Original-To: help-gnu-emacs@gnu.org 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:30589 Archived-At: Neon Absentius writes: > Is there a way to use the command replace-regexp to replace a number with > that number increased, say, by 15? I tried > > C-M-% -?[0-9]+ RET (number-to-string (+ (string-to-number "\&") 15)) RET > > but it doesn't work because emacs interprets the second input to be > a string and so it doesn't evaluate it. So I guess the question is > how can we use the result of evaluating a sexp for replacement text? > > Any help and/or pointers to documentation will be greatly > appreciated. The development version of Emacs would offer C-M-% -?[0-9]+ RET \,(+ \#& 15) RET -- David Kastrup, Kriemhildstr. 15, 44793 Bochum