summaryrefslogtreecommitdiff
path: root/.config/emacs/early-init.el
blob: 62ceaade47a7c83e6b0e14834c9160373ce148b3 (plain)
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
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:


;;;; display load information + speedups
(defun bd/display-startup-time ()
  (message "Emacs loaded in %s with %d garbage collections."
           (format "%.2f seconds"
                   (float-time
                    (time-subtract after-init-time before-init-time)))
           gcs-done))

(add-hook 'emacs-startup-hook #'bd/display-startup-time)

(setq frame-inhibit-implied-resize t)

;; reduce the frequency of garbage collection during startup
;; by making it happen as little as possible
;; TODO: `most-positive-fixnum' will pressure system memory if used
;; as a permanent value
(setopt gc-cons-threshold most-positive-fixnum
        gc-cons-percentage 0.5)

(add-hook 'emacs-startup-hook
          (lambda ()
            (setopt gc-cons-threshold (* 1024 1024 20)
                    gc-cons-percentage 0.2)))


;;;; avoid-blinding startup
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(background-color . "#000000") default-frame-alist)
(push '(foreground-color . "#ffffff") default-frame-alist)


;;; init.el ends here