all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* replace-regexp question
@ 2005-10-26 17:15 Neon Absentius
  0 siblings, 0 replies; 12+ messages in thread
From: Neon Absentius @ 2005-10-26 17:15 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 12+ messages in thread
* replace-regexp question
@ 2003-06-02 11:21 Chang Luo
  2003-06-02 11:53 ` lawrence mitchell
  0 siblings, 1 reply; 12+ messages in thread
From: Chang Luo @ 2003-06-02 11:21 UTC (permalink / raw)


I want to replace regexp "a$" to "a$b$c$".  how to do that?

i.e.  I want:
a    ->     a
            b
            c

But replace-regexp gives me:
a   ->      a$b$c$

Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-10-27 17:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

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.