From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: query-replace-regexp: Can't use \0 in TO-STRING Date: Sun, 07 May 2017 17:48:55 +0300 Message-ID: <83lgq8en8o.fsf@gnu.org> References: <87bmr5micc.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1494168599 24953 195.159.176.226 (7 May 2017 14:49:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 May 2017 14:49:59 +0000 (UTC) Cc: netjune@qq.com, emacs-devel@gnu.org, tino.calancha@gmail.com To: zhanghj Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 07 16:49:53 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 1d7NVQ-0006Ix-2D for ged-emacs-devel@m.gmane.org; Sun, 07 May 2017 16:49:52 +0200 Original-Received: from localhost ([::1]:55778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7NVU-00072t-16 for ged-emacs-devel@m.gmane.org; Sun, 07 May 2017 10:49:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7NUu-00072n-TU for emacs-devel@gnu.org; Sun, 07 May 2017 10:49:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7NUr-000473-0l for emacs-devel@gnu.org; Sun, 07 May 2017 10:49:20 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7NUq-00046z-Tb; Sun, 07 May 2017 10:49:16 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4077 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d7NUq-0000TP-4z; Sun, 07 May 2017 10:49:16 -0400 In-reply-to: <87bmr5micc.fsf@gmail.com> (message from zhanghj on Sun, 07 May 2017 11:55:15 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:214672 Archived-At: > From: zhanghj > Date: Sun, 07 May 2017 11:55:15 +0800 > Cc: netjune@qq.com, Emacs developers > > Tino Calancha writes: > > >> 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? > > The following patch works on my machine for regexp replacing. But I > don't known if \0 should be supported in other places such as > sort-regexp-fields, occur. If this is accepted (and I'm not sure we should), then the user manual should also be updated, and NEWS should have an entry about the change. Thanks.