2024-11-15 18:01:13 +01:00
;;; -*- lexical-binding: t; -*-
2024-11-18 00:28:37 +01:00
2024-12-05 23:50:27 +01:00
;; [[file:../../org-conf/emacs-config.org::*Early Init Variables][Early Init Variables:1]]
2024-11-20 00:49:27 +01:00
( defvar materus/init-early t
" Is emacs using materus early init " ) ; Var to ensure early-init loaded, not used anymore but keeping it anyway
( setq materus/init-early t ) ; Probably useless
2024-11-18 00:28:37 +01:00
2024-11-20 00:49:27 +01:00
( setenv " LSP_USE_PLISTS " " true " ) ; Make lsp-mode use plists
;;
( setq c-default-style nil ) ; Clear default styles for languages, will set them up later
( setq default-input-method nil ) ; Disable default input method, I'm not using them anyway so far
( setq initial-major-mode 'fundamental-mode ) ; Use fundamental mode in scratch buffer, speed up loading, not really important when emacs used as daemon
( setq auto-save-default nil ) ; TODO: configure auto saves, disable for now
( setq backup-directory-alist
` ( ( " .* " . , ( concat user-emacs-directory " var/backups/ " ) ) ) ) ; Set backup location
( setq auto-save-file-name-transforms
` ( ( " .* " , ( concat user-emacs-directory " var/recovery/ " ) t ) ) ) ; Set auto-save location
( setq auto-save-list-file-prefix ( concat user-emacs-directory " var/auto-save/sessions/ " ) ) ; Set auto-save-list location
( setq load-prefer-newer t ) ; Prefer newer files to load
;; Packages
( setq package-enable-at-startup t ) ; Ensure packages are enable since I'm either using built in package manager or nix
( setq package-quickstart nil ) ; Disable package quickstart, it's annoying if forget to update it and doesn't speed up much
;;
( setq inhibit-compacting-font-caches t ) ; Don't compact fonts
( set-language-environment " UTF-8 " ) ; Use UTF-8
( setq custom-file ( concat user-emacs-directory " etc/custom.el " ) ) ; Set custom file location, don't want clutter in main directory
( setq custom-theme-directory
2024-11-20 22:41:58 +01:00
( concat user-emacs-directory " /etc/materus/themes " ) ) ; Set custom themes location
2024-11-20 00:49:27 +01:00
( setq ring-bell-function 'ignore ) ; Disable bell
2024-11-20 22:41:58 +01:00
( defvar materus-emacs-gc-cons-threshold ( * 64 1024 1024 )
2024-11-20 00:49:27 +01:00
" The value of `gc-cons-threshold' after Emacs startup. " ) ; Define after init garbage collector threshold
2024-11-20 00:57:28 +01:00
;; Early Init Variables:1 ends here
2024-11-20 00:49:27 +01:00
2024-12-05 23:50:27 +01:00
;; [[file:../../org-conf/emacs-config.org::*Garbage Collector][Garbage Collector:1]]
2024-11-20 00:49:27 +01:00
( setq gc-cons-threshold most-positive-fixnum ) ; Set `gc-cons-threshold' so it won't collectect during initialization
( add-hook 'emacs-startup-hook
( lambda ( )
( setq gc-cons-threshold materus-emacs-gc-cons-threshold ) ) ) ; Set `gc-cons-threshold' to desired value after startup
2024-11-20 00:57:28 +01:00
;; Garbage Collector:1 ends here
2024-11-20 00:49:27 +01:00
2024-12-05 23:50:27 +01:00
;; [[file:../../org-conf/emacs-config.org::*Early Frame Settings][Early Frame Settings:1]]
2024-11-20 00:49:27 +01:00
( setq frame-inhibit-implied-resize t )
( setq frame-resize-pixelwise t )
( setq window-resize-pixelwise t ) ; Allow pixelwise resizing of window and frame
2023-11-15 00:07:16 +01:00
( unless ( daemonp )
2024-11-20 00:49:27 +01:00
( add-to-list 'initial-frame-alist ' ( fullscreen . maximized ) ) ) ; Start first frame maximized if not running as daemon, daemon frame are set up later in config
( setq default-frame-alist ; Set default size for frames
' ( ( width . 130 )
( height . 40 ) ) )
( advice-add #' tty-run-terminal-initialization :override #' ignore )
( add-hook 'window-setup-hook
( lambda ( )
( unless ( display-graphic-p )
( advice-remove #' tty-run-terminal-initialization #' ignore )
2024-11-15 18:01:13 +01:00
( tty-run-terminal-initialization ( selected-frame ) nil t )
2024-11-20 00:49:27 +01:00
) ) )
2024-11-20 00:57:28 +01:00
;; Early Frame Settings:1 ends here
2024-11-20 00:49:27 +01:00
2024-12-05 23:50:27 +01:00
;; [[file:../../org-conf/emacs-config.org::*Native compilation][Native compilation:1]]
2024-11-20 00:49:27 +01:00
( setq native-comp-async-report-warnings-errors nil ) ; Silence warnings
( setq native-comp-speed 3 ) ; Set native-comp speed
2024-10-28 16:31:39 +01:00
2024-11-20 00:49:27 +01:00
( setq native-comp-jit-compilation t
2024-11-20 22:41:58 +01:00
;;native-comp-deferred-compilation t
2024-11-20 00:49:27 +01:00
package-native-compile t )
;; Setting up native-comp cache location
2024-11-10 11:50:21 +01:00
2024-10-28 16:31:39 +01:00
( when ( and ( fboundp 'startup-redirect-eln-cache )
( fboundp 'native-comp-available-p )
( native-comp-available-p ) )
( startup-redirect-eln-cache
( convert-standard-filename
2024-11-20 22:41:58 +01:00
( concat user-emacs-directory " var/eln-cache/ " ) ) ) )
2024-11-20 00:57:28 +01:00
;; Native compilation:1 ends here