use early-init.el to allow setting native comp cache dir

Some of the init.el setup code moved to early-init.el to allow loading
our init modules in early init.

Loading the native comp init module in init.el set the cache directory variable
too late and resulted in the original directory still being populated
with eln files.
master
John Turner 2 years ago
parent 0487a35147
commit 858ed5a8e7
No known key found for this signature in database
GPG Key ID: 422FE10CC41A94A2

@ -0,0 +1,40 @@
(setq auth-source-save-behavior nil
auto-save-default nil
change-major-mode-with-file-name nil
custom-buffer-indent 4
custom-file (file-name-concat user-emacs-directory "custom.el")
custom-theme-directory (file-name-concat user-emacs-directory "themes/")
debugger 'edebug
enable-local-variables :safe
inferior-lisp-program "sbcl"
inhibit-splash-screen t
make-backup-files nil
scheme-program-name "guile"
tab-width 4
temporary-file-directory (file-name-concat (getenv "HOME") "tmp" ".emacs"))
(setq-default display-fill-column-indicator-column 120
indent-tabs-mode nil)
(let* ((init-modules-wildcard
(file-name-concat user-emacs-directory "init" "*"))
(lisp-modules-wildcard
(file-name-concat user-emacs-directory "lisp" "*"))
(init-modules-files
(file-expand-wildcards init-modules-wildcard t))
(lisp-modules-files
(file-expand-wildcards lisp-modules-wildcard t))
(files
(append init-modules-files lisp-modules-files))
(directories
(seq-filter 'file-directory-p files)))
(mapc (lambda (directory)
(add-to-list 'load-path directory))
directories))
(mkdir temporary-file-directory t)
(require 'init-garbage-collection)
(when (and (>= emacs-major-version 29) (native-comp-available-p))
(require 'init-native-comp))

@ -1,42 +1,9 @@
(require 'seq)
(setq auth-source-save-behavior nil
auto-save-default nil
change-major-mode-with-file-name nil
custom-buffer-indent 4
custom-file (file-name-concat user-emacs-directory "custom.el")
custom-theme-directory (file-name-concat user-emacs-directory "themes/")
debugger 'edebug
enable-local-variables :safe
inferior-lisp-program "sbcl"
inhibit-splash-screen t
make-backup-files nil
scheme-program-name "guile"
tab-width 4)
(setq-default display-fill-column-indicator-column 120
indent-tabs-mode nil)
(let* ((init-modules-wildcard
(file-name-concat user-emacs-directory "init" "*"))
(lisp-modules-wildcard
(file-name-concat user-emacs-directory "lisp" "*"))
(init-modules-files
(file-expand-wildcards init-modules-wildcard t))
(lisp-modules-files
(file-expand-wildcards lisp-modules-wildcard t))
(files
(append init-modules-files lisp-modules-files))
(directories
(seq-filter 'file-directory-p files)))
(mapc (lambda (directory)
(add-to-list 'load-path directory))
directories))
(defmacro require? (feature)
`(require ,feature nil t))
(require? 'site-gentoo)
(unless (when-let ((e (getenv "NO_SITE_GENTOO")))
(string= e "1"))
(require? 'site-gentoo))
(require? 'magit)
@ -50,7 +17,6 @@
(require 'init-eldoc)
(require 'init-electric)
(require 'init-flymake)
(require 'init-garbage-collection)
(require 'init-ibuffer)
(require 'init-ielm)
(require 'init-keys)
@ -71,14 +37,12 @@
(when (require? 'lsp-mode)
(require 'init-lsp-mode))
(when (and (> emacs-major-version 28) (native-comp-available-p))
(require 'init-native-comp))
(when (require? 'pixel-scroll)
(require 'init-pixel-scroll))
(when (and (require? 'treesit) (treesit-available-p))
(require 'init-treesit))
(require 'man-completion)
(require 'license-boilerplate)

@ -1,3 +1,4 @@
(setq native-comp-async-jobs-number (string-to-number (shell-command-to-string "nproc")))
(setq native-comp-async-jobs-number (string-to-number (shell-command-to-string "nproc"))
native-compile-target-directory temporary-file-directory)
(provide 'init-native-comp)

Loading…
Cancel
Save