unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: zhanghj <netjunegg@gmail.com>
Cc: Tino Calancha <tino.calancha@gmail.com>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: query-replace-regexp: Can't use \0 in TO-STRING
Date: Sat, 6 May 2017 14:04:46 +0900 (JST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1705061354350.13425@calancha-pc> (raw)
In-Reply-To: <m2pofmreta.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]



On Sat, 6 May 2017, zhanghj wrote:

> The doc says:
> In TO-STRING, ‘\&’ or ‘\0’ stands for whatever matched the whole of
> REGEXP, and ‘\N’ (where N is a digit) stands for whatever matched
> the Nth ‘\(...\)’ (1-based) in REGEXP.  The ‘\(...\)’ groups are
> counted from 1.
>
> But when using \0, emacs gives the following error message:
> match-substitute-replacement: Invalid use of ‘\’ in replacement text
>
> Using \& is OK.
Thanks.
The docstring for `query-replace-regexp' was updated in commit 38f4b8ea615
to fix Bug#23884.
Apparently, \0 has never referred to the whole match in this command
(\& it does), so we might want to skip \0 from this docstring and the 
manual.

Regards,
Tino

  reply	other threads:[~2017-05-06  5:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06  0:48 query-replace-regexp: Can't use \0 in TO-STRING zhanghj
2017-05-06  5:04 ` Tino Calancha [this message]
2017-05-06  8:09   ` Eli Zaretskii
2017-05-06 10:34     ` Tino Calancha
2017-05-07  3:48     ` zhanghj
2017-05-19  8:13       ` Eli Zaretskii
2017-05-06 12:28   ` zhanghj
2017-05-06 12:39     ` Tino Calancha
2017-05-07  3:55       ` zhanghj
2017-05-07 14:48         ` Eli Zaretskii
2017-05-09 22:02           ` Juri Linkov

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=alpine.DEB.2.20.1705061354350.13425@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=netjunegg@gmail.com \
    /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).