aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 3ffacf7d19..ee73655d74 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2162,7 +2162,14 @@ do_autoload (fundef, funname)
/* Preserve the match data. */
record_unwind_save_match_data ();
- /* Value saved here is to be restored into Vautoload_queue. */
+ /* 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
+ the function. We do this in the specific case of autoloading
+ because autoloading is not an explicit request "load this file",
+ but rather a request to "call this function".
+
+ The value saved here is to be restored into Vautoload_queue. */
record_unwind_protect (un_autoload, Vautoload_queue);
Vautoload_queue = Qt;
Fload (Fcar (Fcdr (fundef)), Qnil, noninteractive ? Qt : Qnil, Qnil, Qt);