summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/tq.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-11-25 15:32:08 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-11-26 14:20:13 +0100
commit558b6dbca7bc933fe01255be9ebeffebd44a2645 (patch)
tree32f4bc6b85c11d31a513afb4b804e7502d00808d /lisp/emacs-lisp/tq.el
parent0287c5176867628e7acb834b3d5f26a150cfaf85 (diff)
downloademacs-558b6dbca7bc933fe01255be9ebeffebd44a2645.tar.gz
emacs-558b6dbca7bc933fe01255be9ebeffebd44a2645.tar.bz2
emacs-558b6dbca7bc933fe01255be9ebeffebd44a2645.zip
Fix replace-regexp-in-string substring match data translation
For certain patterns, re-matching the same regexp on the matched substring does not produce correctly translated match data (bug#15107 and bug#44861). Using a new builtin function also improves performance since the number of calls to string-match is halved. Reported by Kevin Ryde and Shigeru Fukaya. * lisp/subr.el (replace-regexp-in-string): Translate the match data using match-data--translate instead of trusting a call to string-match on the matched string to do the job. * test/lisp/subr-tests.el (subr-replace-regexp-in-string): Add test cases. * src/search.c (Fmatch_data__translate): New internal function. (syms_of_search): Register it as a subroutine.
Diffstat (limited to 'lisp/emacs-lisp/tq.el')
0 files changed, 0 insertions, 0 deletions