if (STRINGP (table))
{
AUTO_STRING (intl, "international/");
- result = Fload (concat2 (intl, table), Qt, Qt, Qt, Qt);
+ result = save_match_data_load (concat2 (intl, table), Qt, Qt, Qt, Qt);
if (NILP (result))
return Qnil;
table = XCDR (val);
if (NILP (file))
Fsnarf_documentation (Vdoc_file_name);
else
- Fload (file, Qt, Qt, Qt, Qnil);
+ save_match_data_load (file, Qt, Qt, Qt, Qnil);
return 1;
}
CHECK_SYMBOL (funname);
- /* Preserve the match data. */
- record_unwind_save_match_data ();
-
/* If autoloading gets an error (which includes the error of failing
to define the function being called), we use Vautoload_queue
to undo function definitions and `provide' calls made by
so don't signal an error if autoloading fails. */
Lisp_Object ignore_errors
= (EQ (kind, Qt) || EQ (kind, Qmacro)) ? Qnil : macro_only;
- Fload (Fcar (Fcdr (fundef)), ignore_errors, Qt, Qnil, Qt);
+ save_match_data_load (Fcar (Fcdr (fundef)), ignore_errors, Qt, Qnil, Qt);
/* Once loading finishes, don't undo it. */
Vautoload_queue = Qt;
Vautoload_queue = Qt;
/* Load the file. */
- tem = Fload (NILP (filename) ? Fsymbol_name (feature) : filename,
- noerror, Qt, Qnil, (NILP (filename) ? Qt : Qnil));
+ tem = save_match_data_load
+ (NILP (filename) ? Fsymbol_name (feature) : filename,
+ noerror, Qt, Qnil, (NILP (filename) ? Qt : Qnil));
/* If load failed entirely, return nil. */
if (NILP (tem))
if (initialized)
Vcurrent_load_list = Fcons (x, Vcurrent_load_list);
}
+extern Lisp_Object save_match_data_load (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object *, Lisp_Object, bool);
enum { S2N_IGNORE_TRAILING = 1 };
return Qt;
}
+
+Lisp_Object
+save_match_data_load (Lisp_Object file, Lisp_Object noerror,
+ Lisp_Object nomessage, Lisp_Object nosuffix,
+ Lisp_Object must_suffix)
+{
+ ptrdiff_t count = SPECPDL_INDEX ();
+ record_unwind_save_match_data ();
+ Lisp_Object result = Fload (file, noerror, nomessage, nosuffix, must_suffix);
+ return unbind_to (count, result);
+}
\f
static bool
complete_filename_p (Lisp_Object pathname)