aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-08-29 11:29:01 +0200
committerAndrea Corallo2020-08-29 16:08:03 +0200
commit87b9c3e71840f480c2ce05eb51d71156790a5434 (patch)
treece73778ef0d2b3008f57ae17c366f517555b2036 /src
parent38b0ead7c1a8475bef7f811b07beed2c23cbc593 (diff)
downloademacs-87b9c3e71840f480c2ce05eb51d71156790a5434.tar.gz
emacs-87b9c3e71840f480c2ce05eb51d71156790a5434.zip
Have .elc files in `load-history' when loading native code (bug#43089)
* src/lread.c (Fload): Add the corresponding .elc file to `load-history' when loading native code. * lisp/subr.el (eval-after-load): Use `load-file-name' instead of `load-true-file-name'.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/lread.c b/src/lread.c
index 326af307f9c..ac5b2838eef 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1322,10 +1322,23 @@ Return t if the file exists and loads successfully. */)
1322 specbind (Qlexical_binding, Qnil); 1322 specbind (Qlexical_binding, Qnil);
1323 1323
1324 /* Get the name for load-history. */ 1324 /* Get the name for load-history. */
1325 Lisp_Object found_for_hist;
1326 if (is_native_elisp)
1327 {
1328 /* Reconstruct the .elc filename. */
1329 Lisp_Object src_name = Fgethash (Ffile_name_nondirectory (found),
1330 Vcomp_eln_to_el_h, Qnil);
1331 if (suffix_p (src_name, "el.gz"))
1332 src_name = Fsubstring (src_name, make_fixnum (0), make_fixnum (-3));
1333 found_for_hist = concat2 (src_name, build_string ("c"));
1334 }
1335 else
1336 found_for_hist = found;
1337
1325 hist_file_name = (! NILP (Vpurify_flag) 1338 hist_file_name = (! NILP (Vpurify_flag)
1326 ? concat2 (Ffile_name_directory (file), 1339 ? concat2 (Ffile_name_directory (file),
1327 Ffile_name_nondirectory (found)) 1340 Ffile_name_nondirectory (found_for_hist))
1328 : found) ; 1341 : found_for_hist);
1329 1342
1330 version = -1; 1343 version = -1;
1331 1344
@@ -1504,13 +1517,6 @@ Return t if the file exists and loads successfully. */)
1504 { 1517 {
1505#ifdef HAVE_NATIVE_COMP 1518#ifdef HAVE_NATIVE_COMP
1506 specbind (Qcurrent_load_list, Qnil); 1519 specbind (Qcurrent_load_list, Qnil);
1507 if (!NILP (Vpurify_flag))
1508 {
1509 Lisp_Object base = concat2 (parent_directory (Vinvocation_directory),
1510 build_string ("lisp/"));
1511 Lisp_Object offset = Flength (base);
1512 hist_file_name = Fsubstring (found, offset, Qnil);
1513 }
1514 LOADHIST_ATTACH (hist_file_name); 1520 LOADHIST_ATTACH (hist_file_name);
1515 Fnative_elisp_load (found, Qnil); 1521 Fnative_elisp_load (found, Qnil);
1516 build_load_history (hist_file_name, true); 1522 build_load_history (hist_file_name, true);