From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: query-replace-regexp: Can't use \0 in TO-STRING Date: Sat, 6 May 2017 21:39:25 +0900 (JST) Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1494074419 23597 195.159.176.226 (6 May 2017 12:40:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 May 2017 12:40:19 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: netjune@qq.com, Emacs developers , Tino Calancha To: zhanghj Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 06 14:40:12 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6z0O-00060G-Dm for ged-emacs-devel@m.gmane.org; Sat, 06 May 2017 14:40:12 +0200 Original-Received: from localhost ([::1]:51337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6z0T-0003EC-Vd for ged-emacs-devel@m.gmane.org; Sat, 06 May 2017 08:40:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6yzl-0003D4-Uv for emacs-devel@gnu.org; Sat, 06 May 2017 08:39:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6yzi-0002XI-SL for emacs-devel@gnu.org; Sat, 06 May 2017 08:39:33 -0400 Original-Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:35089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6yzi-0002XA-MD for emacs-devel@gnu.org; Sat, 06 May 2017 08:39:30 -0400 Original-Received: by mail-pg0-x241.google.com with SMTP id i63so4173766pgd.2 for ; Sat, 06 May 2017 05:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=sLtSbnXmwxggiAHjJNXBE0FqGyA80uzgh1epvnB8y5M=; b=Z2PBYP8UMfHqc+3fmsutyu7dbJ3x12aX4quszYUz/qtOb1RtsdMorDaEzByhbTSZ2d Tq178Pzk22n9PWPF4KM6busaUbE4o06GQ95UpgULKWRStRka1q2fHRMeCUZtvHNV6cL3 KQRckUEHrf6UjrNoSr58zxzeWRP14NzlNbxP4wzzZMIbfdxmtqoyZMkiVfAPjHu08LKC ABt0/QGRj8Hri7kAJwioLQ+KoXygNvMRLRuw/MzUJqRH3jI1GVxBP6ItBj5JNZ15FMj1 93hIcg6Ip4PV9bIBvEV4oDw2hfi/vMu91C7flkBE5g0hbgWlkoEAWTgVn0Hqq6T6hG/e NLIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=sLtSbnXmwxggiAHjJNXBE0FqGyA80uzgh1epvnB8y5M=; b=qREssLoPbeELiI/WXluTJ8foh3H2M0IQzUlzX5w7tCAtHWb0VCa8JsmaZv2YKmcS4h lXSzV5vyO+ESQ4QQpVakkEd6oUGgHysbbSmP12KXDGshSqPXkx0YfEpzR5Mu4MmME6rL 2eO58DuNWWfF1Xt/kRhC/uvTLstgF20+g9nP1NYWZwz3OGmJItUUR5/RZZbylQb9hteR QkpGWxWttsOGwH/ctgQgYwi9oj05pVV24OAMuG/CYslurhBSdBCMK65hQhfzkahdC/v0 vdiwSxRodrp4kCv5a2JZhXEKRYcaCAfNuyWFzLL/HxjN1YXgMPHvI0pSW6sPZBSmx3Ix 7gLw== X-Gm-Message-State: AODbwcC1guXCoifM9ykGjXNgYa+urQKEAAM/lVOO2q4MpWc6pZc4joKZ og0T/XuibQ2DMg== X-Received: by 10.99.51.74 with SMTP id z71mr2347375pgz.137.1494074369576; Sat, 06 May 2017 05:39:29 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id y2sm14109114pfb.93.2017.05.06.05.39.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 May 2017 05:39:28 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214620 Archived-At: On Sat, 6 May 2017, zhanghj wrote: > Tino Calancha writes: > >> 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 > Why not \0? I think \0 is more intuitive and also used in vim. I agree is more intuitive, and it works in `replace-match', or instance: (mapcar (lambda (group) (let ((str "foo123")) (when (string-match "[a-z]+\\([1-9]+\\)" str) (replace-match "bar" nil nil str group)))) (list 0 1)) => ("bar" "foobar") Are you willing to write a patch to implement it?