From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: 8161@debbugs.gnu.org
Subject: bug#8161: 24.0.50; query-replace-regexp fails with interactive replacement text
Date: Thu, 3 Mar 2011 00:59:37 -0800 [thread overview]
Message-ID: <20110303005937.1804abf6@bhishma.homelinux.net> (raw)
Hi Emacs devs,
I wanted to replace interactively all numbers in the text of an 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("\\?" nil nil #("1" 0 1 (fontified
> t)) nil) match-substitute-replacement("\\?" nil 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)
Since the doc string of `query-replace-regexp' says the following:
> ...
> In TO-STRING, `\&' stands for whatever matched the whole of REGEXP,
> and `\N' (where N is a digit) stands for
> whatever what matched the Nth `\(...\)' in REGEXP.
> `\?' lets you edit the replacement text in the minibuffer
> at the given position for each replacement.
> ...
and two other users have confirmed[1] this behaviour on the
help-gnu-emacs list, I believe this is a bug. I have included all the
information below starting emacs with "emacs -Q".
Hope this helps tracking down the bug.
Suvayu
[1]http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/8f5ef5f9ade589e3#
In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
of 2011-03-02 on bhishma.homelinux.net
Windowing system distributor `Fedora Project', version 11.0.10802000
configured using `configure '--prefix=/opt/emacs-lisp'
'--with-selinux' '--with-imagemagick''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_IN.utf8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: Debugger
Minor modes in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
1 <return> 2 <return> 3 <return> 4 <return> <return>
5 <up> <delete> <down> <down> <return> 6 <return> 7
<return> 8 <return> 9 <return> 0 <return> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<down> <down> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar>
<options> <debug-on-error> C-M-% [ 0 - 9 ] + <return>
\ ? <return> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> C-SPC <down> <down> <down> <down> <down>
<down> <down> M-w M-x e m a c s - r e p o <tab> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> r e
p o <tab> t <tab> <backspace> r t <tab> - <tab> <backspace>
<tab> <return>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
byte-code: End of buffer [2 times]
Debug on Error enabled globally
Mark set
Entering debugger...
byte-code: Beginning of buffer [4 times]
Mark set
byte-code: End of buffer
Making completion list...
Load-path shadows:
/opt/emacs-lisp/share/emacs/site-lisp/flim/hex-util
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/hex-util /opt/emacs-lisp/share/emacs/site-lisp/flim/sha1
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/sha1 /opt/emacs-lisp/share/emacs/site-lisp/flim/md4
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/md4 /opt/emacs-lisp/share/emacs/site-lisp/flim/ntlm
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/ntlm /opt/emacs-lisp/share/emacs/site-lisp/flim/sasl
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/sasl /opt/emacs-lisp/share/emacs/site-lisp/flim/sasl-digest
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/sasl-digest /opt/emacs-lisp/share/emacs/site-lisp/flim/sasl-cram
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/sasl-cram /opt/emacs-lisp/share/emacs/site-lisp/flim/sasl-ntlm
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/sasl-ntlm /opt/emacs-lisp/share/emacs/site-lisp/flim/hmac-md5
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/hmac-md5 /opt/emacs-lisp/share/emacs/site-lisp/flim/hmac-def
hides /opt/emacs-lisp/share/emacs/24.0.50/lisp/net/hmac-def
Features:
(shadow sort mail-extr message idna sendmail regexp-opt rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev mail-utils gmm-utils mailheader emacsbug url-util
url-parse auth-source eieio byte-opt bytecomp byte-compile assoc
gnus-util time-date password-cache url-vars mm-util mail-prsvr help-mode
easymenu view debug cus-start cus-load tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties overlay
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)
--
Suvayu
Open source is the future. It sets us free.
next reply other threads:[~2011-03-03 8:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 8:59 Suvayu Ali [this message]
2011-03-03 16:21 ` bug#8161: 24.0.50; query-replace-regexp fails with interactive replacement text Lawrence Mitchell
2011-03-03 23:04 ` Juri Linkov
2012-08-05 13:31 ` Chong Yidong
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110303005937.1804abf6@bhishma.homelinux.net \
--to=fatkasuvayu+linux@gmail.com \
--cc=8161@debbugs.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).