From 696ab2eb17cf8850a65814f428287848b7d23d64 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 28 Aug 2020 18:37:44 +0200 Subject: [PATCH] * src/lread.c (Fload): Bind load-file-name to the .elc filename. --- src/lread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lread.c b/src/lread.c index 3d0de495605..5b77868a63b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1477,8 +1477,10 @@ Return t if the file exists and loads successfully. */) same folder of their respective sources therfore not to break packages we fake `load-file-name' here. The non faked version of it is `load-true-file-name'. */ - specbind (Qload_file_name, Fgethash (Ffile_name_nondirectory (found), - Vcomp_eln_to_el_h, Qnil)); + Lisp_Object el_name = Fgethash (Ffile_name_nondirectory (found), + Vcomp_eln_to_el_h, Qnil); + specbind (Qload_file_name, + NILP (el_name) ? Qnil : concat2 (el_name, build_string ("c"))); } else specbind (Qload_file_name, found); -- 2.39.5