unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Neon Absentius <absent@sdf.lonestar.org>
Subject: replace-regexp question
Date: Wed, 26 Oct 2005 17:15:57 +0000	[thread overview]
Message-ID: <20051026171557.GA8593@SDF.LONESTAR.ORG> (raw)

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. 

-- 
 There is no national science just as there is no national
multiplication table; what is national is no longer science.
         -- Anton Checov

             reply	other threads:[~2005-10-26 17:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-26 17:15 Neon Absentius [this message]
     [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
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
  -- 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=20051026171557.GA8593@SDF.LONESTAR.ORG \
    --to=absent@sdf.lonestar.org \
    /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).