main
1;;; early-init.el --- Early initialization -*- lexical-binding: t -*-
2(add-to-list 'load-path (locate-user-emacs-file "site-lisp"))
3
4;; Do not initialize installed packages
5(setopt package-enable-at-startup nil
6 package-archives nil
7 package-quickstart nil)
8(setopt use-package-ensure-function 'ignore)
9
10;; Do not resize the frame at this early stage
11(setopt frame-inhibit-implied-resize t
12 frame-resize-pixelwise t
13 frame-title-format '("%b")) ;; do not add "GNU Emacs at …"
14
15;; Disable GUI elements
16(push '(menu-bar-lines . 0) default-frame-alist)
17(push '(tool-bar-lines . 0) default-frame-alist)
18(push '(vertical-scroll-bars) default-frame-alist)
19(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
20(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
21(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
22(when (fboundp 'horizontal-scroll-bar-mode) (horizontal-scroll-bar-mode -1))
23
24(setopt use-dialog-box nil ;; never use dialog-box (no mouse)
25 use-file-dialog nil ;; never use file dialog (gtk)
26 use-short-answers t ;; replace defalias yes-or-no-p
27 read-answer-short t) ;; accepts single-character answer, similar to above
28
29(setopt inhibit-startup-message t
30 inhibit-startup-screen t
31 inhibit-startup-echo-area-message user-login-name ; read the docstring
32 inhibit-startup-buffer-menu t)
33
34(setq gc-cons-threshold most-positive-fixnum
35 gc-cons-percentage 0.5)
36
37(defvar vde--file-name-handler-alist file-name-handler-alist)
38(defvar vde--vc-handled-backends vc-handled-backends)
39(setq file-name-handler-alist nil
40 vc-handled-backends nil)
41
42;; Ignore X resources; its settings would be redundant with the other settings
43;; in this file and can conflict with later config (particularly where the
44;; cursor color is concerned).
45(advice-add #'x-apply-session-resources :override #'ignore)
46(setopt inhibit-x-resources t)
47
48;;
49(when (getenv-internal "DEBUG")
50 (setq init-file-debug t
51 debug-on-error t))
52
53;; - Resetting garbage collection and file-name-handler values.
54(add-hook 'after-init-hook
55 #'(lambda ()
56 (setq gc-cons-threshold 67108864 ; 64mb
57 gc-cons-percentage 0.1
58 file-name-handler-alist vde--file-name-handler-alist
59 vc-handled-backends vde--vc-handled-backends)
60 (garbage-collect)) t)