GNU bug report logs - #12622
replace-regexp-in-string

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Thu, 11 Oct 2012 14:19:02 UTC

Severity: normal

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12622 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: bug#12622: replace-regexp-in-string
Date: Fri, 12 Oct 2012 18:07:30 +0200
Am 12.10.2012 16:22, schrieb Stefan Monnier:
>> Nonetheless consider it a design flaw, us it requires a argument taking
>> function, where a expression just to evaluate would suffice.
>
> You need some way to distinguish "here's an expression that will return
> the string that needs to be passed as argument" from "here's the
> expression that needs to be passed as argument, to be evaluated later in
> each iteration of the loop".  The distinction is made by wrapping the
> expression in a `lambda'.
>
>
>          Stefan
>

will keep that under my pillow :)

back to the question:

what about writing here instead

 (funcall rep (match-string 0 str)))

just

(eval rep)

i.e. let the user decide how to construct, if not delivered a regexp as string

Best,

Andreas




This bug report was last modified 12 years and 225 days ago.

Previous Next


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