-
Notifications
You must be signed in to change notification settings - Fork 4
/
early-init.el
42 lines (36 loc) · 1.69 KB
/
early-init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(setq package-enable-at-startup nil)
;; package-quickstart t
;; load-prefer-newer t)
;; Prevent the glimpse of un-styled Emacs by disabling these UI elements early.
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
;; Courtesy: Doom Emacs
(unless (daemonp)
(defvar file-name-handler-alist-backup file-name-handler-alist)
(setq file-name-handler-alist nil)
;; Restore `file-name-handler-alist' later, because it is needed for handling
;; encrypted or compressed files, among other things.
(defun reset-file-handler-alist-h ()
;; Re-add rather than `setq', because changes to `file-name-handler-alist'
;; since startup ought to be preserved.
(dolist (handler file-name-handler-alist)
(add-to-list 'file-name-handler-alist-backup handler))
(setq file-name-handler-alist file-name-handler-alist-backup))
(add-hook 'emacs-startup-hook #'reset-file-handler-alist-h)
(setq-default inhibit-redisplay t
inhibit-message t)
(add-hook 'window-setup-hook
(lambda ()
(setq-default inhibit-redisplay nil
inhibit-message nil)
(redisplay))))
(defvar gc-cons-threshold-backup gc-cons-threshold)
(setq gc-cons-threshold most-positive-fixnum)
(defun reset-gc-cons-threshold()
(setq gc-cons-threshold gc-cons-threshold-backup))
(add-hook 'emacs-startup-hook #'reset-gc-cons-threshold)
;; 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)