all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: suvayu ali <fatkasuvayu+linux@gmail.com>
To: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: query-replace-regexp interactive replacement string
Date: Wed, 2 Mar 2011 14:52:33 -0800	[thread overview]
Message-ID: <AANLkTimeUvUkdF8zXLbT5LYMH+fLScQyA=61e8t51O5P@mail.gmail.com> (raw)

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.



             reply	other threads:[~2011-03-02 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 22:52 suvayu ali [this message]
2011-03-03  8:03 ` query-replace-regexp interactive replacement string 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

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='AANLkTimeUvUkdF8zXLbT5LYMH+fLScQyA=61e8t51O5P@mail.gmail.com' \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@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.