all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* query-replace-regexp interactive replacement string
@ 2011-03-02 22:52 suvayu ali
  2011-03-03  8:03 ` Deniz Dogan
  0 siblings, 1 reply; 6+ messages in thread
From: suvayu ali @ 2011-03-02 22:52 UTC (permalink / raw)
  To: Emacs mailing list

Hi Emacs users,

I wanted to replace interactively all numbers in the text of an org-mode
document with the number in words, so I tried:

`C-M-% [0-9]+ RET \? RET'

But this gives me an error like this:

> Debugger entered--Lisp error: (error "Invalid use of `\\' in replacement text")
>   replace-match("\\?" t nil #("2" 0 1 (fontified t)) nil)
>   match-substitute-replacement("\\?" t nil)
>   perform-replace("[0-9]+" "\\?" t t nil nil nil nil nil)
>   query-replace-regexp("[0-9]+" "\\?" nil nil nil)
>   call-interactively(query-replace-regexp nil nil)
>   recursive-edit()
>   perform-replace("[0-9]+" "?" t t nil nil nil nil nil)
>   query-replace-regexp("[0-9]+" "?" nil nil nil)
>   call-interactively(query-replace-regexp nil nil)

Since the doc string of `query-replace-regexp' says the following:

> ...
> In TO-STRING, ...
> `\?' lets you edit the replacement text in the minibuffer
> at the given position for each replacement.
> ...

I am not sure what I did wrong. I am using GNU Emacs 24.0.50.1
(x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)

Thanks for any thoughts.

-- 
Suvayu

Open source is the future. It sets us free.



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

end of thread, other threads:[~2011-03-03  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 22:52 query-replace-regexp interactive replacement string suvayu ali
2011-03-03  8:03 ` Deniz Dogan
2011-03-03  8:11   ` Suvayu Ali
2011-03-03  8:35     ` Deniz Dogan
2011-03-03  9:14       ` Suvayu Ali
2011-03-03  8:39     ` Andreas Röhler

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.