GNU bug report logs - #23005
24.4; regexp replace evaluating replacements in incorrect order

Previous Next

Package: emacs;

Reported by: Ernesto Alfonso <erjoalgo <at> gmail.com>

Date: Mon, 14 Mar 2016 00:18:02 UTC

Severity: normal

Found in version 24.4

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ernesto Alfonso <erjoalgo <at> gmail.com>
Cc: 23005 <at> debbugs.gnu.org
Subject: bug#23005: 24.4; regexp replace evaluating replacements in incorrect order
Date: Mon, 29 Jul 2019 14:59:21 +0200
Ernesto Alfonso <erjoalgo <at> gmail.com> 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




This bug report was last modified 5 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.