all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Subject: Re: replace-regexp question
Date: Wed, 26 Oct 2005 19:34:11 +0200	[thread overview]
Message-ID: <85d5lsji7g.fsf@lola.goethe.zz> (raw)
In-Reply-To: mailman.12812.1130346970.20277.help-gnu-emacs@gnu.org

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

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

       reply	other threads:[~2005-10-26 17:34 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 ` David Kastrup [this message]
2005-10-26 18:24   ` replace-regexp question 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
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85d5lsji7g.fsf@lola.goethe.zz \
    --to=dak@gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.