emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug Report -- replace-regexp-in-string from subr.el


From: Andreas Schwab
Subject: Re: Bug Report -- replace-regexp-in-string from subr.el
Date: Sun, 20 Apr 2014 08:40:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Sam Fiechter <address@hidden> writes:

> I noticed that the lisp function replace-regexp-in-string from emacs
> 24.4.50.1 does not pass the sub-expression match when the rep is a function
> call rather than a string.

Which matches the documentation:

    REP is either a string used as the NEWTEXT arg of `replace-match' or a
    function.  If it is a function, it is called with the actual text of each
    match, and its value is used as the replacement text.  When REP is called,
    the match data are the result of matching REGEXP against a substring
    of STRING.

The "actual text of each match" is (match-string 0), not (match-string
subexp).

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]