[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sending multiple patches
From: |
Stefan Monnier |
Subject: |
Re: Sending multiple patches |
Date: |
Tue, 03 Jun 2014 09:25:08 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
> Unfortunately that is not the case. For example, imagine a hypothetical
^^^^^^^^^^^^
As you say, it's hypothetical.
AFAICT, there's currently no actual use of regular expressions in the
"end pattern", so we very much can regexp-quote the whole thing (or
alternatively search it via search-forward instead of
re-search-forward). If/when a need for something more flexible comes
up, we can allow the use of "a function returning a regexp" or maybe
even better "a function that jumps to the end" instead of a string.
> Do you think that adding Perl's \Q…\E support to `replace-match' would
> make sense?
No. This would naturally lead to adding support for other operations
than regexp-quote, and then you end up quoting chunks of code inside
strings which is not only ugly but can't be macroexpanded, can't refer
to lexical-scoped vars, can't be byte-compiled, ...
If useful, we could extend replace-match such that NEWTEXT can be
a function instead of a string. That should be easy and clean.
Stefan
Re: Sending multiple patches, Michal Nazarewicz, 2014/06/02