summaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-10-03 15:26:04 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-10-03 15:26:13 +0200
commit5fec9182dbeffa88cef6651d8c798ef9665d6681 (patch)
treeeef3635bcb19cb75c58bece1b45922951fe9d4c3 /src/comp.c
parentda02b9edadbc809b25ac83eccf64089f1cf3b160 (diff)
downloademacs-5fec9182dbeffa88cef6651d8c798ef9665d6681.tar.gz
Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables): Document it. * lisp/startup.el (normal-top-level): Set inhibit-native-compilation from environment variable. * lisp/subr.el (native-comp-deferred-compilation): Make obsolete. * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write trampolines to disk. * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load): Adjust. * src/comp.c (syms_of_comp): New variable inhibit-native-compilation. (maybe_defer_native_compilation): Use it.
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c
index 4813ca04a90..ed64a850721 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5107,6 +5107,7 @@ maybe_defer_native_compilation (Lisp_Object function_name,
return;
if (!native_comp_deferred_compilation
+ || !NILP (Vinhibit_native_compilation)
|| noninteractive
|| !NILP (Vpurify_flag)
|| !COMPILEDP (definition)
@@ -5610,6 +5611,13 @@ For internal use. */);
doc: /* Non-nil when comp.el can be native compiled.
For internal use. */);
/* Compiler control customizes. */
+ DEFVAR_LISP ("inhibit-native-compilation", Vinhibit_native_compilation,
+ doc: /* If non-nil, inhibit automatic native compilation of loaded .elc files.
+
+After compilation, each function definition is updated to the native
+compiled one. */);
+ Vinhibit_native_compilation = Qnil;
+
DEFVAR_BOOL ("native-comp-deferred-compilation",
native_comp_deferred_compilation,
doc: /* If non-nil compile loaded .elc files asynchronously.