From dc393517ca1cfef7770bffdfe2b7fd3c2c5e7bbf Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Thu, 1 Apr 2021 14:27:12 +0200 Subject: Issue a warning when eln look-up fails due to missing .el source file. * lisp/emacs-lisp/comp.el (comp-warning-on-missing-source): New customize. * src/lread.c (maybe_swap_for_eln): Issue a warning when eln look-up fails due to missing .el source file. * src/comp.c (syms_of_comp): Define 'Qcomp_warning_on_missing_source'. --- src/comp.c | 3 ++- src/lread.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/comp.c b/src/comp.c index eb734d5833d..67c8e39315b 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5254,7 +5254,8 @@ compiled one. */); DEFSYM (Qlate, "late"); DEFSYM (Qlambda_fixup, "lambda-fixup"); DEFSYM (Qgccjit, "gccjit"); - DEFSYM (Qcomp_subr_trampoline_install, "comp-subr-trampoline-install") + DEFSYM (Qcomp_subr_trampoline_install, "comp-subr-trampoline-install"); + DEFSYM (Qcomp_warning_on_missing_source, "comp-warning-on-missing-source"); /* To be signaled by the compiler. */ DEFSYM (Qnative_compiler_error, "native-compiler-error"); diff --git a/src/lread.c b/src/lread.c index ec6f09238ba..156df73de82 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1674,8 +1674,16 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, { src_name = concat2 (src_name, build_string (".gz")); if (NILP (Ffile_exists_p (src_name))) - /* Can't find the corresponding source file. */ - return; + { + if (!NILP (find_symbol_value (Qcomp_warning_on_missing_source))) + call2 (intern_c_string ("display-warning"), + Qcomp, + CALLN (Fformat, + build_string ("Cannot look-up eln file as no source " + "file was found for %s"), + *filename)); + return; + } } Lisp_Object eln_rel_name = Fcomp_el_to_eln_rel_filename (src_name); -- cgit v1.3