all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Extra information in autoload error
@ 2016-09-21 20:53 Alex
  2016-09-21 21:13 ` Davis Herring
  0 siblings, 1 reply; 14+ messages in thread
From: Alex @ 2016-09-21 20:53 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 138 bytes --]

I felt that the error that `autoload-do-load` throws when it runs into a
failed autoload is lacking, so I made the following adjustment:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: using Vload_history --]
[-- Type: text/x-diff, Size: 530 bytes --]

diff --git a/src/eval.c b/src/eval.c
index e08a25a..3c619ba 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1987,8 +1987,9 @@ it defines a macro.  */)
       Lisp_Object fun = Findirect_function (funname, Qnil);
 
       if (!NILP (Fequal (fun, fundef)))
-	error ("Autoloading failed to define function %s",
-	       SDATA (SYMBOL_NAME (funname)));
+	error ("Autoloading failed to define function %s in file %s",
+	       SDATA (SYMBOL_NAME (funname)),
+	       SDATA (Fcar (Fcar (Vload_history))));
       else
 	return fun;
     }

[-- Attachment #3: Type: text/plain, Size: 172 bytes --]




This should give the file that was checked for the autoload. I tested it
out and it seems to work. In case Vload_history can't be used, I also
tried out the following:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: patch using funname --]
[-- Type: text/x-diff, Size: 529 bytes --]

diff --git a/src/eval.c b/src/eval.c
index e08a25a..8a573de 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1987,8 +1987,9 @@ it defines a macro.  */)
       Lisp_Object fun = Findirect_function (funname, Qnil);
 
       if (!NILP (Fequal (fun, fundef)))
-	error ("Autoloading failed to define function %s",
-	       SDATA (SYMBOL_NAME (funname)));
+	error ("Autoloading failed to define function %s with filename %s",
+	       SDATA (SYMBOL_NAME (funname)),
+	       SDATA (Fcar (Fcdr (fundef))));
       else
 	return fun;
     }

[-- Attachment #5: Type: text/plain, Size: 120 bytes --]




Would one of these be considered for inclusion into Emacs? I think both
error messages are more helpful than before.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-11-04  8:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21 20:53 [PATCH] Extra information in autoload error Alex
2016-09-21 21:13 ` Davis Herring
2016-09-21 22:16   ` Alex
2016-10-22 16:23     ` Alex
2016-10-22 16:30       ` Eli Zaretskii
2016-10-22 19:40       ` Stefan Monnier
2016-10-22 20:23         ` Alex
2016-10-23  5:53           ` Eli Zaretskii
2016-10-23 21:24             ` Alex
2016-10-24  6:30               ` Eli Zaretskii
2016-10-24 19:21                 ` Alex
2016-10-24 19:56                   ` Eli Zaretskii
2016-10-25  5:47                     ` Alex
2016-11-04  8:43                       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.