summaryrefslogtreecommitdiffstats
path: root/.emacs.d/early-init.el
blob: 00602806c0fa33a1b1ef27738be6df0d026c1f81 (plain) (blame)
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
;;; early-init.el --- bandali's early init -*- lexical-binding: t -*-

;; Copyright (c) 2019-2025 Amin Bandali <bandali@gnu.org>

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

(setq load-prefer-newer t)

(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(blink-cursor-mode -1)

(defconst b/gc-cons-threshold gc-cons-threshold)
(defconst b/gc-cons-percentage gc-cons-percentage)
(defvar b/file-name-handler-alist file-name-handler-alist)
(setq
 gc-cons-threshold (* 30 1024 1024) ; 30 MiB
 gc-cons-percentage 0.6
 file-name-handler-alist nil)

;; Set them back to their defaults once we're done initializing.
(defun b/post-init ()
  "My post-initialization function."
  (setq
   gc-cons-threshold b/gc-cons-threshold
   gc-cons-percentage b/gc-cons-percentage
   file-name-handler-alist b/file-name-handler-alist))
(add-hook 'after-init-hook #'b/post-init)