summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/loading.texi3
-rw-r--r--src/fns.c13
2 files changed, 12 insertions, 4 deletions
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 1199cfaa0f0..d925c8c8f65 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -900,8 +900,7 @@ if loading the file fails. Normally, @code{require} returns
@var{feature}.
If loading the file succeeds but does not provide @var{feature},
-@code{require} signals an error, @samp{Required feature @var{feature}
-was not provided}.
+@code{require} signals an error about the missing feature.
@end defun
@defun featurep feature &optional subfeature
diff --git a/src/fns.c b/src/fns.c
index 10d35b6112a..0332ab5dad0 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2797,8 +2797,17 @@ suppressed. */)
tem = Fmemq (feature, Vfeatures);
if (NILP (tem))
- error ("Required feature `%s' was not provided",
- SDATA (SYMBOL_NAME (feature)));
+ {
+ unsigned char *tem2 = SDATA (SYMBOL_NAME (feature));
+ Lisp_Object tem3 = Fcar (Fcar (Vload_history));
+
+ if (NILP (tem3))
+ error ("Required feature `%s' was not provided", tem2);
+ else
+ /* Cf autoload-do-load. */
+ error ("Loading file %s failed to provide feature `%s'",
+ SDATA (tem3), tem2);
+ }
/* Once loading finishes, don't undo it. */
Vautoload_queue = Qt;