50 lines
2.4 KiB
EmacsLisp
50 lines
2.4 KiB
EmacsLisp
;;; pre-early-init.el --- Pre Early Initalization -*- no-byte-compile: t; lexical-binding: t; -*-
|
|
|
|
(defconst rs/emacs-dir minimal-emacs-user-directory)
|
|
(defconst rs/lib-dir (concat (expand-file-name "lib" minimal-emacs-user-directory) "/"))
|
|
|
|
;; Reducing clutter in ~/.emacs.d by redirecting files to ~/emacs.d/var/
|
|
(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory))
|
|
(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir))
|
|
(setq user-emacs-directory minimal-emacs-var-dir)
|
|
|
|
;; By default, minimal-emacs-package-initialize-and-refresh is set to t, which
|
|
;; makes minimal-emacs.d call the built-in package manager. Since Elpaca will
|
|
;; replace the package manager, there is no need to call it.
|
|
(setq minimal-emacs-package-initialize-and-refresh nil)
|
|
|
|
(setq minimal-emacs-gc-cons-threshold (* 64 1024 1024))
|
|
|
|
(setq custom-file null-device)
|
|
|
|
;; disable screen flashing because bg color hasn't initialized yet from theme
|
|
;; (setq default-frame-alist '((background-color . "#062329")
|
|
;; (ns-appearance . dark)
|
|
;; (ns-transparent-titlebar . t)))
|
|
(setq default-frame-alist '((background-color . "#072626")
|
|
(ns-appearance . dark)
|
|
(ns-transparent-titlebar . t)
|
|
(frame-resize-pixelwise . t)))
|
|
;; (setq default-frame-alist '((ns-appearance . dark)
|
|
;; (ns-transparent-titlebar . t)))
|
|
|
|
;; Use dynamic GCC paths to avoid recompilation when Homebrew updates GCC
|
|
(when-let* ((gcc-base "/opt/homebrew/opt/gcc/lib/gcc/current")
|
|
((file-directory-p gcc-base)))
|
|
(setenv "LIBRARY_PATH"
|
|
(string-join
|
|
(delq nil
|
|
(list gcc-base
|
|
(let ((jit-path "/opt/homebrew/opt/libgccjit/lib/gcc/current"))
|
|
(when (file-directory-p jit-path) jit-path))
|
|
;; Find the arch-specific directory (e.g., aarch64-apple-darwin24/15)
|
|
(car (last (file-expand-wildcards
|
|
(concat gcc-base "/gcc/aarch64-apple-darwin*/*"))))))
|
|
":")))
|
|
|
|
;; Native compilation settings to reduce unnecessary recompilation
|
|
(when (native-comp-available-p)
|
|
(setq native-comp-async-report-warnings-errors 'silent)
|
|
(setq native-compile-prune-cache t)
|
|
;; Redirect eln-cache to writable location (default goes to read-only ~/.emacs.d/)
|
|
(startup-redirect-eln-cache (expand-file-name "eln-cache/" minimal-emacs-var-dir)))
|