From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: replace-regexp question Date: 26 Oct 2005 21:24:29 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <86oe5cm90i.fsf@flame.pc> References: <85d5lsji7g.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1130351982 4901 80.91.229.2 (26 Oct 2005 18:39:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Oct 2005 18:39:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 26 20:39:37 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EUq7b-0008RM-Kl for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Oct 2005 20:35:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EUq7b-0003uh-2F for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Oct 2005 14:35:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uninett.no!news.banetele.no!dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 19 Original-NNTP-Posting-Host: 62.103.39.226 Original-X-Trace: news.sunsite.dk DXC=l_o7K:CQHZCCbPFlQZmVYDYSB=nbEKnkKX[=QjfN5DHDL^MjG2:ak; I7eU]G6nT6d; jI9iO 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:30590 Archived-At: David Kastrup writes: >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 Oh, heh! Very neat ;)