From d2a6c43b6fd3f393924b024b33e30b560b2d2adc Mon Sep 17 00:00:00 2001 From: "Tobias C. Rittweiler" Date: Sun, 3 Jul 2011 20:44:53 +0200 Subject: [PATCH] * searching.texi (Match Data): Note that match data can be overwritten by most functions. Fixes: debbugs:2499 --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/searching.texi | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index f2206cd78e..807313c863 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2011-07-03 Tobias C. Rittweiler (tiny change) + + * searching.texi (Match Data): Note that match data can be + overwritten by most functions (bug#2499). + 2011-07-03 Lars Magne Ingebrigtsen * strings.texi (Formatting Strings): Clarify what the "-" and "0" diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 27b089f75b..6272301dbb 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1207,6 +1207,12 @@ search you wish to refer back to and the use of the match data. If you can't avoid another intervening search, you must save and restore the match data around it, to prevent it from being overwritten. + Notice that all functions are allowed to overwrite the match data +unless they're explicitly documented not to do so. A consequence is +that functions that are run implictly in the background +(@pxref{Timers}, and @ref{Idle Timers}) should likely save and restore +the match data explicitly. + @menu * Replacing Match:: Replacing a substring that was matched. * Simple Match Data:: Accessing single items of match data, -- 2.20.1