* bug#23005: 24.4; regexp replace evaluating replacements in incorrect order
@ 2016-03-14 0:17 Ernesto Alfonso
2019-07-29 12:59 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Ernesto Alfonso @ 2016-03-14 0:17 UTC (permalink / raw)
To: 23005
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 "\?".
In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
of 2015-03-07 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11604000
System Description: Debian GNU/Linux 8.3 (jessie)
Configured using:
`configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
--build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/lib --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
--with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
LDFLAGS=-Wl,-z,relro'
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Javascript
Minor modes in effect:
shell-dirtrack-mode: t
text-scale-mode: t
global-text-scale-mode: t
global-command-mode: t
command-mode: t
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#23005: 24.4; regexp replace evaluating replacements in incorrect order
2016-03-14 0:17 bug#23005: 24.4; regexp replace evaluating replacements in incorrect order Ernesto Alfonso
@ 2019-07-29 12:59 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-29 12:59 UTC (permalink / raw)
To: Ernesto Alfonso; +Cc: 23005
Ernesto Alfonso <erjoalgo@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-29 12:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-14 0:17 bug#23005: 24.4; regexp replace evaluating replacements in incorrect order Ernesto Alfonso
2019-07-29 12:59 ` Lars Ingebrigtsen
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.