From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: suvayu ali Newsgroups: gmane.emacs.help Subject: query-replace-regexp interactive replacement string Date: Wed, 2 Mar 2011 14:52:33 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1299106984 30324 80.91.229.12 (2 Mar 2011 23:03:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Mar 2011 23:03:04 +0000 (UTC) To: Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 03 00:03:00 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Puv4M-0002fr-L3 for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Mar 2011 00:02:58 +0100 Original-Received: from localhost ([127.0.0.1]:38810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuuvB-0002Go-6t for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Mar 2011 17:53:29 -0500 Original-Received: from [140.186.70.92] (port=58443 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Puuuf-0002Dk-0u for help-gnu-emacs@gnu.org; Wed, 02 Mar 2011 17:52:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Puuud-0000X0-U5 for help-gnu-emacs@gnu.org; Wed, 02 Mar 2011 17:52:56 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:61255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Puuud-0000WZ-LS for help-gnu-emacs@gnu.org; Wed, 02 Mar 2011 17:52:55 -0500 Original-Received: by bwz17 with SMTP id 17so757074bwz.0 for ; Wed, 02 Mar 2011 14:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=ybVbaz/bEjOBP/nHIRFm/Kp63QHeU27V3U72vIlNeIs=; b=hYwYLdfLiOkO3Z2AUzofdrqDqZZF1UYQ9ya1eq7UwhKocKQ7lFljKkc7kaXbABtOrf Nx7OxeqPW4J5txqr7UqfIBUyBSd6h1q7LQFETSCHm3xAr8XVJkRGkRw3G+Br0+NE5/qO Z+BMjIrMFZlYzb2fKmCC5E5dETZkZcJFIl8VE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=efojOFQm2VcOvfaAGfMjWSNILP5yeqke3n5OT/qTV4l5pRuaXP0Li1H5iu6XNRfr2C KzkH4/AVOfaPlWitv+4kggHcZmbO+6Ro9aXZECkTb525G1uHFBHVZZ8LiR/zyDkeYF8y 6kwEKCPMYYYDqGIcwS8ZH9GjRrj1jokRG5njU= Original-Received: by 10.204.66.148 with SMTP id n20mr668478bki.44.1299106373155; Wed, 02 Mar 2011 14:52:53 -0800 (PST) Original-Received: by 10.204.79.3 with HTTP; Wed, 2 Mar 2011 14:52:33 -0800 (PST) X-Google-Sender-Auth: SfWH7N5xakziKIM13gorohggXrE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79713 Archived-At: 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.