From 58326f0f117b229b690023d3851a00d876a7aca6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 9 May 2017 19:47:16 -0400 Subject: [PATCH] More informative error when required feature missing * 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 | 3 +-- src/fns.c | 13 +++++++++++-- 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; -- 2.39.2