[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replace-regexp question
From: |
Giorgos Keramidas |
Subject: |
Re: replace-regexp question |
Date: |
26 Oct 2005 21:24:29 +0300 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
David Kastrup <dak@gnu.org> writes:
>Neon Absentius <absent@sdf.lonestar.org> 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 ;)