From: Giorgos Keramidas <keramida@ceid.upatras.gr>
Subject: Re: replace-regexp question
Date: 26 Oct 2005 21:24:29 +0300 [thread overview]
Message-ID: <86oe5cm90i.fsf@flame.pc> (raw)
In-Reply-To: 85d5lsji7g.fsf@lola.goethe.zz
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 ;)
next prev parent reply other threads:[~2005-10-26 18:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.12812.1130346970.20277.help-gnu-emacs@gnu.org>
2005-10-26 17:34 ` replace-regexp question David Kastrup
2005-10-26 18:24 ` Giorgos Keramidas [this message]
2005-10-26 19:52 ` David Kastrup
2005-10-27 9:01 ` Harald Hanche-Olsen
2005-10-27 9:32 ` David Kastrup
2005-10-27 11:47 ` Neon Absentius
2005-10-27 14:38 ` Sébastien Kirche
2005-10-27 15:08 ` David Kastrup
2005-10-27 17:24 ` Sébastien Kirche
2005-10-26 17:15 Neon Absentius
-- strict thread matches above, loose matches on Subject: below --
2003-06-02 11:21 Chang Luo
2003-06-02 11:53 ` lawrence mitchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86oe5cm90i.fsf@flame.pc \
--to=keramida@ceid.upatras.gr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).