diff options
| author | Andrea Corallo | 2021-03-31 14:49:36 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2021-03-31 19:56:10 +0200 |
| commit | 613caa9527ef56fb9b810d2b9478cbe9784baca0 (patch) | |
| tree | f8728f743ec52298e8680355eb0f6a8f0bf46134 | |
| parent | 515378434a44b9979e8c8a6e04203695095bdc40 (diff) | |
| download | emacs-613caa9527ef56fb9b810d2b9478cbe9784baca0.tar.gz emacs-613caa9527ef56fb9b810d2b9478cbe9784baca0.zip | |
Do not defer compilation when bytecode is explicitly requested (bug#46617)
* 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.
| -rw-r--r-- | lisp/faces.el | 3 | ||||
| -rw-r--r-- | src/comp.c | 10 | ||||
| -rw-r--r-- | src/lread.c | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 42f4cddfb1b..68bfbbae384 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2244,7 +2244,8 @@ If you set `term-file-prefix' to nil, this function does nothing." | |||
| 2244 | (let ((file (locate-library (concat term-file-prefix type)))) | 2244 | (let ((file (locate-library (concat term-file-prefix type)))) |
| 2245 | (and file | 2245 | (and file |
| 2246 | (or (assoc file load-history) | 2246 | (or (assoc file load-history) |
| 2247 | (load file t t))))) | 2247 | (load (file-name-sans-extension file) |
| 2248 | t t))))) | ||
| 2248 | type) | 2249 | type) |
| 2249 | ;; Next, try to find a matching initialization function, and call it. | 2250 | ;; Next, try to find a matching initialization function, and call it. |
| 2250 | (tty-find-type #'(lambda (type) | 2251 | (tty-find-type #'(lambda (type) |
diff --git a/src/comp.c b/src/comp.c index 857f798a8d8..b286f6077f3 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -4689,7 +4689,8 @@ maybe_defer_native_compilation (Lisp_Object function_name, | |||
| 4689 | || !NILP (Vpurify_flag) | 4689 | || !NILP (Vpurify_flag) |
| 4690 | || !COMPILEDP (definition) | 4690 | || !COMPILEDP (definition) |
| 4691 | || !STRINGP (Vload_true_file_name) | 4691 | || !STRINGP (Vload_true_file_name) |
| 4692 | || !suffix_p (Vload_true_file_name, ".elc")) | 4692 | || !suffix_p (Vload_true_file_name, ".elc") |
| 4693 | || !NILP (Fgethash (Vload_true_file_name, V_comp_no_native_file_h, Qnil))) | ||
| 4693 | return; | 4694 | return; |
| 4694 | 4695 | ||
| 4695 | Lisp_Object src = | 4696 | Lisp_Object src = |
| @@ -5373,6 +5374,13 @@ This is used to prevent double trampoline instantiation but also to | |||
| 5373 | protect the trampolines against GC. */); | 5374 | protect the trampolines against GC. */); |
| 5374 | Vcomp_installed_trampolines_h = CALLN (Fmake_hash_table); | 5375 | Vcomp_installed_trampolines_h = CALLN (Fmake_hash_table); |
| 5375 | 5376 | ||
| 5377 | DEFVAR_LISP ("comp-no-native-file-h", V_comp_no_native_file_h, | ||
| 5378 | doc: /* Files for which no deferred compilation has to | ||
| 5379 | be performed because the bytecode version was explicitly requested by | ||
| 5380 | the user during load. | ||
| 5381 | For internal use. */); | ||
| 5382 | V_comp_no_native_file_h = CALLN (Fmake_hash_table, QCtest, Qequal); | ||
| 5383 | |||
| 5376 | Fprovide (intern_c_string ("nativecomp"), Qnil); | 5384 | Fprovide (intern_c_string ("nativecomp"), Qnil); |
| 5377 | #endif /* #ifdef HAVE_NATIVE_COMP */ | 5385 | #endif /* #ifdef HAVE_NATIVE_COMP */ |
| 5378 | 5386 | ||
diff --git a/src/lread.c b/src/lread.c index e8c257a13cc..ec6f09238ba 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1656,6 +1656,12 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, | |||
| 1656 | struct stat eln_st; | 1656 | struct stat eln_st; |
| 1657 | 1657 | ||
| 1658 | if (no_native | 1658 | if (no_native |
| 1659 | || load_no_native) | ||
| 1660 | Fputhash (*filename, Qt, V_comp_no_native_file_h); | ||
| 1661 | else | ||
| 1662 | Fremhash (*filename, V_comp_no_native_file_h); | ||
| 1663 | |||
| 1664 | if (no_native | ||
| 1659 | || load_no_native | 1665 | || load_no_native |
| 1660 | || !suffix_p (*filename, ".elc")) | 1666 | || !suffix_p (*filename, ".elc")) |
| 1661 | return; | 1667 | return; |