From: Glenn Morris Date: Tue, 9 May 2017 23:47:16 +0000 (-0400) Subject: More informative error when required feature missing X-Git-Tag: emacs-26.0.90~521^2~426 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58326f0f117b229b690023d3851a00d876a7aca6;p=emacs.git 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. --- 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;