From 34d34c279601c86d76ab9ca8b8bf415fb78a8273 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 19 Mar 2025 07:59:43 -0400 Subject: [PATCH] Add minimal-emacs-enable-native-compilation --- early-init.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/early-init.el b/early-init.el index 5321cba..2c3d332 100644 --- a/early-init.el +++ b/early-init.el @@ -65,6 +65,13 @@ tradeoff is that the mode line is hidden during the startup phase.") When set to non-nil, Emacs will automatically call `package-initialize' and `package-refresh-contents' to set up and update the package system.") +(defvar minimal-emacs-setup-native-compilation t + "If non-nil, enable and configure native compilation. +When enabled, this variable sets the following: +- `native-comp-deferred-compilation' +- `native-comp-jit-compilation' +- `package-native-compile'") + (defvar minimal-emacs-user-directory user-emacs-directory "The default value of the `user-emacs-directory' variable.") @@ -141,9 +148,9 @@ pre-early-init.el, and post-early-init.el.") (fboundp 'native-comp-available-p) (native-comp-available-p)) ;; Activate `native-compile' - (setq native-comp-jit-compilation t - native-comp-deferred-compilation t - package-native-compile t) + (setq native-comp-deferred-compilation minimal-emacs-setup-native-compilation + native-comp-jit-compilation minimal-emacs-setup-native-compilation + package-native-compile minimal-emacs-setup-native-compilation) ;; Deactivate the `native-compile' feature if it is not available (setq features (delq 'native-compile features)))