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 Schwab <schwab <at> linux-m68k.org>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 12622 <at> debbugs.gnu.org
Subject: bug#12622: replace-regexp-in-string
Date: Thu, 11 Oct 2012 16:44:03 +0200
Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

> Also would expect a respective form working with replace-regexp-in-string
>
> (setq mystring "[.A foobar] [.B baz]")
> (replace-regexp-in-string  "\\_<\\w+\\_>" (concat "\\\\" (match-string-no-properties 0) )   mystring)
>
> but it fails.

Fails in which way?  What do you expect, and what do you get?

> When commenting "(match-string 0 str)" as follows it subr.el it works
>
> 	(setq matches
> 	      (cons (replace-match (if (stringp rep)
> 				       rep
> 				     (funcall rep
>                                               ;; (match-string 0 str)
> ))
> 				   fixedcase literal str subexp)
>
> Which has some plausibility: when receiving a user-specified function, there must not be that argument.

Why?  That's what the doc string documents.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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.