From: Eli Zaretskii <eliz@gnu.org>
To: zhanghj <netjunegg@gmail.com>
Cc: netjune@qq.com, emacs-devel@gnu.org, tino.calancha@gmail.com
Subject: Re: query-replace-regexp: Can't use \0 in TO-STRING
Date: Sun, 07 May 2017 17:48:55 +0300 [thread overview]
Message-ID: <83lgq8en8o.fsf@gnu.org> (raw)
In-Reply-To: <87bmr5micc.fsf@gmail.com> (message from zhanghj on Sun, 07 May 2017 11:55:15 +0800)
> From: zhanghj <netjunegg@gmail.com>
> Date: Sun, 07 May 2017 11:55:15 +0800
> Cc: netjune@qq.com, Emacs developers <emacs-devel@gnu.org>
>
> Tino Calancha <tino.calancha@gmail.com> 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.
next prev parent reply other threads:[~2017-05-07 14:48 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83lgq8en8o.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=netjune@qq.com \
--cc=netjunegg@gmail.com \
--cc=tino.calancha@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.