summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-11-16 22:16:01 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-11-16 22:16:01 +0000
commitb51d6c92fd5567e37d43f4ccd9a575c48d9ebbb3 (patch)
tree59e5544d8b75926d402e3a31467d29d23293b064 /src/search.c
parent59938af3338f4b06cdf036d34c26b42e014665e4 (diff)
downloademacs-b51d6c92fd5567e37d43f4ccd9a575c48d9ebbb3.tar.gz
(Fset_match_data): Remove the `evaporate' feature.
(unwind_set_match_data): Don't use the `evaporate' feature.
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/search.c b/src/search.c
index 3a9fabeb3ce..ad4fbc45469 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2892,11 +2892,15 @@ Return value is undefined if the last search failed. */)
return reuse;
}
-/* Internal usage only:
- If RESEAT is `evaporate', put the markers back on the free list
- immediately. No other references to the markers must exist in this case,
- so it is used only internally on the unwind stack and save-match-data from
- Lisp. */
+/* We used to have an internal use variant of `reseat' described as:
+
+ If RESEAT is `evaporate', put the markers back on the free list
+ immediately. No other references to the markers must exist in this
+ case, so it is used only internally on the unwind stack and
+ save-match-data from Lisp.
+
+ But it was ill-conceived: those supposedly-internal markers get exposed via
+ the undo-list, so freeing them here is unsafe. */
DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0,
doc: /* Set internal data on last search match from elements of LIST.
@@ -2981,10 +2985,7 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */)
if (!NILP (reseat) && MARKERP (m))
{
- if (EQ (reseat, Qevaporate))
- free_marker (m);
- else
- unchain_marker (XMARKER (m));
+ unchain_marker (XMARKER (m));
XSETCAR (list, Qnil);
}
@@ -3002,10 +3003,7 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */)
if (!NILP (reseat) && MARKERP (m))
{
- if (EQ (reseat, Qevaporate))
- free_marker (m);
- else
- unchain_marker (XMARKER (m));
+ unchain_marker (XMARKER (m));
XSETCAR (list, Qnil);
}
}
@@ -3069,8 +3067,8 @@ static Lisp_Object
unwind_set_match_data (list)
Lisp_Object list;
{
- /* It is safe to free (evaporate) the markers immediately. */
- return Fset_match_data (list, Qevaporate);
+ /* It is NOT ALWAYS safe to free (evaporate) the markers immediately. */
+ return Fset_match_data (list, Qt);
}
/* Called to unwind protect the match data. */