mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
65 lines
2.5 KiB
EmacsLisp
65 lines
2.5 KiB
EmacsLisp
;;; early-init.el --- jimeh's Emacs Siren: early init file. -*- lexical-binding: nil; -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;; The file before the file that starts it all.
|
|
|
|
;;; Code:
|
|
|
|
;; Native-Comp
|
|
(setq native-comp-speed 2
|
|
comp-speed 2)
|
|
(setq native-comp-async-report-warnings-errors nil
|
|
comp-async-report-warnings-errors nil)
|
|
(setq native-comp-async-query-on-exit t
|
|
comp-async-query-on-exit t)
|
|
|
|
;; Prevent native-compiling .dir-locals.el and *-autoloads.el files.
|
|
(let ((deny-list '("\\(?:[/\\\\]\\.dir-locals\\.el$\\)"
|
|
"\\(?:[/\\\\][^/\\\\]+-autoloads\\.el$\\)")))
|
|
(cond
|
|
((boundp 'native-comp-jit-compilation-deny-list)
|
|
(setq native-comp-jit-compilation-deny-list deny-list))
|
|
((boundp 'native-comp-deferred-compilation-deny-list)
|
|
(setq native-comp-deferred-compilation-deny-list deny-list))
|
|
((boundp 'comp-deferred-compilation-deny-list)
|
|
(setq comp-deferred-compilation-deny-list deny-list))))
|
|
|
|
(when (or (boundp 'comp-eln-load-path) (boundp 'native-comp-eln-load-path))
|
|
(let ((eln-cache-dir (expand-file-name "cache/eln-cache/"
|
|
user-emacs-directory))
|
|
(find-exec (executable-find "find")))
|
|
|
|
(if (boundp 'native-comp-eln-load-path)
|
|
(setcar native-comp-eln-load-path eln-cache-dir)
|
|
(setcar comp-eln-load-path eln-cache-dir))
|
|
;; Quitting emacs while native compilation in progress can leave zero byte
|
|
;; sized *.eln files behind. Hence delete such files during startup.
|
|
(when find-exec
|
|
(call-process find-exec nil nil nil eln-cache-dir
|
|
"-name" "*.eln" "-size" "0" "-delete" "-or"
|
|
"-name" "*.eln.tmp" "-size" "0" "-delete"))))
|
|
|
|
;; Defer garbage collection further back in the startup process
|
|
(setq gc-cons-threshold most-positive-fixnum)
|
|
|
|
;; Disable Emacs 27's automatic package.el initialization before the init.el
|
|
;; file is loaded. We use Elpaca instead of package.el.
|
|
(setq package-enable-at-startup nil)
|
|
|
|
;; Prevent the glimpse of un-styled Emacs by disabling these UI elements early.
|
|
(setq tool-bar-mode nil
|
|
menu-bar-mode nil)
|
|
(when (fboundp 'set-scroll-bar-mode)
|
|
(set-scroll-bar-mode nil))
|
|
|
|
;; Resizing the Emacs frame can be a terribly expensive part of changing the
|
|
;; font. By inhibiting this, we easily halve startup times with fonts that are
|
|
;; larger than the system default.
|
|
(setq frame-inhibit-implied-resize t)
|
|
|
|
;; Set lsp-mode to use plists for performance improvements.
|
|
(setenv "LSP_USE_PLISTS" "true")
|
|
|
|
;;; early-init.el ends here
|