[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: query-replace-regexp: Can't use \0 in TO-STRING
From: |
Eli Zaretskii |
Subject: |
Re: query-replace-regexp: Can't use \0 in TO-STRING |
Date: |
Sun, 07 May 2017 17:48:55 +0300 |
> From: zhanghj <address@hidden>
> Date: Sun, 07 May 2017 11:55:15 +0800
> Cc: address@hidden, Emacs developers <address@hidden>
>
> Tino Calancha <address@hidden> 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.