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.
if (!NILP (reseat) && MARKERP (m))
{
- if (EQ (reseat, Qevaporate))
- free_marker (m);
- else
- unchain_marker (XMARKER (m));
+ unchain_marker (XMARKER (m));
XSETCAR (list, Qnil);
}
if (!NILP (reseat) && MARKERP (m))
{
- if (EQ (reseat, Qevaporate))
- free_marker (m);
- else
- unchain_marker (XMARKER (m));
+ unchain_marker (XMARKER (m));
XSETCAR (list, Qnil);
}
}
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. */
DEFVAR_LISP ("inhibit-changing-match-data", &Vinhibit_changing_match_data,
doc: /* Internal use only.
-If non-nil, the match data will not be changed during call to searching or
-matching functions, such as `looking-at', `string-match', `re-search-forward'
-etc. */);
+If non-nil, the primitive searching and matching functions
+such as `looking-at', `string-match', `re-search-forward', etc.,
+do not set the match data. The proper way to use this variable
+is to bind it with `let' around a small expression. */);
Vinhibit_changing_match_data = Qnil;
defsubr (&Slooking_at);