[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Extra information in autoload error
From: |
Alex |
Subject: |
[PATCH] Extra information in autoload error |
Date: |
Wed, 21 Sep 2016 14:53:52 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
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:
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;
}
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:
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;
}
Would one of these be considered for inclusion into Emacs? I think both
error messages are more helpful than before.
- [PATCH] Extra information in autoload error,
Alex <=