]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not defer compilation when bytecode is explicitly requested (bug#46617)
authorAndrea Corallo <akrl@sdf.org>
Wed, 31 Mar 2021 12:49:36 +0000 (14:49 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 31 Mar 2021 17:56:10 +0000 (19:56 +0200)
* src/comp.c (maybe_defer_native_compilation): Check if the file
is registered in 'V_comp_no_native_file_h'.
(syms_of_comp): 'V_comp_no_native_file_h' new global.
* src/lread.c (maybe_swap_for_eln): Register files in
'V_comp_no_native_file_h'.
* lisp/faces.el (tty-run-terminal-initialization): Do not
explicitly load .elc file to not exclude .eln being loaded in
place.

lisp/faces.el
src/comp.c
src/lread.c

index 42f4cddfb1b2d1c494109e147df51fc162ea128f..68bfbbae384a032ab6d8ea8e4855271d4c79f882 100644 (file)
@@ -2244,7 +2244,8 @@ If you set `term-file-prefix' to nil, this function does nothing."
                           (let ((file (locate-library (concat term-file-prefix type))))
                             (and file
                                  (or (assoc file load-history)
-                                     (load file t t)))))
+                                     (load (file-name-sans-extension file)
+                                            t t)))))
                       type)
        ;; Next, try to find a matching initialization function, and call it.
        (tty-find-type #'(lambda (type)
index 857f798a8d8418cdd0bdded341f7a30646b1c747..b286f6077f3e1ba98855a99a1587edfc355f0f3d 100644 (file)
@@ -4689,7 +4689,8 @@ maybe_defer_native_compilation (Lisp_Object function_name,
       || !NILP (Vpurify_flag)
       || !COMPILEDP (definition)
       || !STRINGP (Vload_true_file_name)
-      || !suffix_p (Vload_true_file_name, ".elc"))
+      || !suffix_p (Vload_true_file_name, ".elc")
+      || !NILP (Fgethash (Vload_true_file_name, V_comp_no_native_file_h, Qnil)))
     return;
 
   Lisp_Object src =
@@ -5373,6 +5374,13 @@ This is used to prevent double trampoline instantiation but also to
 protect the trampolines against GC.  */);
   Vcomp_installed_trampolines_h = CALLN (Fmake_hash_table);
 
+  DEFVAR_LISP ("comp-no-native-file-h", V_comp_no_native_file_h,
+              doc: /* Files for which no deferred compilation has to
+be performed because the bytecode version was explicitly requested by
+the user during load.
+For internal use.  */);
+  V_comp_no_native_file_h = CALLN (Fmake_hash_table, QCtest, Qequal);
+
   Fprovide (intern_c_string ("nativecomp"), Qnil);
 #endif /* #ifdef HAVE_NATIVE_COMP */
 
index e8c257a13ccd4477d6fe1ad702fd281a1747bd9e..ec6f09238bad410fc3847db31aaf99a512a8e697 100644 (file)
@@ -1655,6 +1655,12 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
 #ifdef HAVE_NATIVE_COMP
   struct stat eln_st;
 
+  if (no_native
+      || load_no_native)
+    Fputhash (*filename, Qt, V_comp_no_native_file_h);
+  else
+    Fremhash (*filename, V_comp_no_native_file_h);
+
   if (no_native
       || load_no_native
       || !suffix_p (*filename, ".elc"))