[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
query-replace-regexp interactive replacement string
From: |
suvayu ali |
Subject: |
query-replace-regexp interactive replacement string |
Date: |
Wed, 2 Mar 2011 14:52:33 -0800 |
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.
- query-replace-regexp interactive replacement string,
suvayu ali <=