emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 0a3e715 1/2: * Introduce `comp-file-preloaded-p'


From: Andrea Corallo
Subject: feature/native-comp 0a3e715 1/2: * Introduce `comp-file-preloaded-p'
Date: Mon, 5 Apr 2021 15:20:31 -0400 (EDT)

branch: feature/native-comp
commit 0a3e715e1f5e13874139b4678375b8f5704b800b
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Introduce `comp-file-preloaded-p'
    
        * src/comp.c (syms_of_comp): Define `comp-file-preloaded-p'.
        (Fcomp_el_to_eln_filename): Account for `comp-file-preloaded-p'.
---
 src/comp.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 6817fe2..c4b9b4b 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4131,16 +4131,18 @@ directory in `comp-eln-load-path' otherwise.  */)
   if (!file_name_absolute_p (SSDATA (base_dir)))
     base_dir = Fexpand_file_name (base_dir, Vinvocation_directory);
 
-  /* In case the file being compiled is found in 'LISP_PRELOADED'
-     target for output the 'preloaded' subfolder.  */
+  /* In case the file being compiled is found in 'LISP_PRELOADED' or
+     `comp-file-preloaded-p' is non-nil target for output the
+     'preloaded' subfolder.  */
   Lisp_Object lisp_preloaded =
     Fgetenv_internal (build_string ("LISP_PRELOADED"), Qnil);
   base_dir = Fexpand_file_name (Vcomp_native_version_dir, base_dir);
-  if (!NILP (lisp_preloaded)
-      && !NILP (Fmember (CALL1I (file-name-base, source_filename),
-                        Fmapcar (intern_c_string ("file-name-base"),
-                                 CALL1I (split-string, lisp_preloaded)))))
-         base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir);
+  if (comp_file_preloaded_p
+      || (!NILP (lisp_preloaded)
+         && !NILP (Fmember (CALL1I (file-name-base, source_filename),
+                            Fmapcar (intern_c_string ("file-name-base"),
+                                     CALL1I (split-string, lisp_preloaded))))))
+    base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir);
 
   return Fexpand_file_name (filename, base_dir);
 }
@@ -5398,6 +5400,10 @@ the user during load.
 For internal use.  */);
   V_comp_no_native_file_h = CALLN (Fmake_hash_table, QCtest, Qequal);
 
+  DEFVAR_BOOL ("comp-file-preloaded-p", comp_file_preloaded_p,
+              doc: /* When non-nil assume the file being compiled to
+be preloaded.  */);
+
   Fprovide (intern_c_string ("nativecomp"), Qnil);
 #endif /* #ifdef HAVE_NATIVE_COMP */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]