]> git.eshelyaron.com Git - emacs.git/commitdiff
More informative error when required feature missing
authorGlenn Morris <rgm@gnu.org>
Tue, 9 May 2017 23:47:16 +0000 (19:47 -0400)
committerGlenn Morris <rgm@gnu.org>
Tue, 9 May 2017 23:47:16 +0000 (19:47 -0400)
* src/fns.c (Frequire): Include file name in missing feature error.
* doc/lispref/loading.texi (Named Features): Don't quote actual error.

doc/lispref/loading.texi
src/fns.c

index 1199cfaa0f094b3ed6cf7bab4f1223dfb72cf3f8..d925c8c8f6506e03c6d0b731cf4430421d84e6a9 100644 (file)
@@ -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
index 10d35b6112a8306f1247fb9084dd76a2de3abfd2..0332ab5dad03ecef6b8b11d7ff632cdd3d190d2c 100644 (file)
--- 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;