Subject: Re: bug#23005: 24.4; regexp replace evaluating replacements in incorrect order

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 29 Jul 2019 14:59:21 +0200

Ernesto Alfonso <[email-masked]> writes:

> when using replace-regexp with both expressions (ie \,) and simple
> string replacements (ie \?), the expression replacement is evaluated
> first, even if it comes after the \? replacement.
>
> Example:
>
> Replace regexp (default '.*?', *'.*' -> '\?', '\,(read-string "silly
> expression")'):
>
> the (read-string "silly expression") is evaluated before the first "\?".

I'm not sure this is a bug -- the doc string doesn't say anything about
the order these things are done in.  On the other hand, it doesn't seem
very useful to do the evaluation first.  If the evaluation could return
things like \&, then perhaps doing it first would be useful...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no