summary refs log tree commit diff stats
path: root/early-init.el
diff options
context:
space:
mode:
Diffstat (limited to 'early-init.el')
-rw-r--r--early-init.el95
1 files changed, 30 insertions, 65 deletions
diff --git a/early-init.el b/early-init.el index c569cc5..bb6454e 100644 --- a/early-init.el +++ b/early-init.el
@@ -1,5 +1,5 @@
1;;; early-init.el -*- lexical-binding: t; coding: utf-8-unix -*- 1;;; early-init.el -*- lexical-binding: t; coding: utf-8-unix -*-
2;; Author: Case Duckworth <acdw@acdw.net> 2;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")>
3;; Created: Sometime during Covid-19, 2020 3;; Created: Sometime during Covid-19, 2020
4;; Keywords: configuration 4;; Keywords: configuration
5;; URL: https://tildegit.org/acdw/emacs 5;; URL: https://tildegit.org/acdw/emacs
@@ -24,43 +24,24 @@
24 load-path) 24 load-path)
25(require 'acdw) 25(require 'acdw)
26(require 'acdw-frame) 26(require 'acdw-frame)
27;;; Speed up init
28;; see doom-emacs, et al.
29
30(setq acdw/orig-file-name-handler-alist file-name-handler-alist
31 file-name-handler-alist nil
32 gc-cons-percentage 0.8
33 gc-cons-threshold most-positive-fixnum
34 load-prefer-newer noninteractive)
35
36(add-hook 'after-init-hook
37 (defun after-init@reset ()
38 "Reset `file-name-handler-alist' and garbage collection."
39 (setq gc-cons-percentage 0.1
40 gc-cons-threshold (* 800 1024 1024))
41 (dolist (handler file-name-handler-alist)
42 (add-to-list 'acdw/orig-file-name-handler-alist handler))
43 (setq file-name-handler-alist acdw/orig-file-name-handler-alist)))
44 27
45;;; Frame settings 28;;; Frame settings
46(setq default-frame-alist ; Remove most UI 29(setq default-frame-alist
47 `((tool-bar-lines . 0) ; No tool bar 30 `((tool-bar-lines . 0)
48 (menu-bar-lines . 0) ; No menu bar 31 (menu-bar-lines . 0)
49 (vertical-scroll-bars) ; No scroll bars 32 (vertical-scroll-bars . nil)
50 (horizontal-scroll-bars) ; ... at all 33 (horizontal-scroll-bars . nil)
51 (width . 84) ; A /little/ wider than 34 (width . 84)
52 ; `fill-column' (set later)
53 (height . 30) 35 (height . 30)
54 (left-fringe . 8) ; Width of fringes 36 (left-fringe . 8)
55 (right-fringe . 8) ; (8 is default) 37 (right-fringe . 8)
56 (font . ,(acdw/system 38 (font . ,(acdw/system
57 (:home "DejaVu Sans Mono 10") 39 (:home "DejaVu Sans Mono 10")
58 (:work "Consolas 12") 40 (:work "Consolas 12")
59 (:other "monospace 10")))) 41 (:other "monospace 10"))))
60 frame-inhibit-implied-resize t ; Don't resize randomly 42 frame-inhibit-implied-resize t
61 frame-resize-pixelwise t ; Resize by pixels, not chars 43 frame-resize-pixelwise t
62 inhibit-x-resources t ; Don't load ~/.Xresources 44 inhibit-x-resources t)
63 )
64 45
65(add-hook 'after-init-hook 46(add-hook 'after-init-hook
66 (defun after-init@disable-ui-modes () 47 (defun after-init@disable-ui-modes ()
@@ -81,26 +62,23 @@ say, `tool-bar-mode' once to toggle the tool bar back on."
81(add-hook 'after-make-frame-functions 62(add-hook 'after-make-frame-functions
82 (defun after-make-frame@setup (&rest args) 63 (defun after-make-frame@setup (&rest args)
83 (ignore args) 64 (ignore args)
84 (let ((monospace-faces 65 (let ((fixed-pitch-faces
85 ;; (acdw/system
86 ;; (:work '((:font "Consolas" :height 110)
87 ;; (:font "DejaVu Sans Mono" :height 110)
88 ;; (:font "monospace" :height 110)))
89 ;; (_ '((:font "DejaVu Sans Mono" :height 100)
90 ;; (:font "Consolas" :height 100)
91 ;; (:font "monospace" :height 100))))
92 '((:font "Fantasque Sans Mono" :height 110) 66 '((:font "Fantasque Sans Mono" :height 110)
93 (:font "Go Mono" :height 100) 67 (:font "Go Mono" :height 100)
94 (:font "DejaVu Sans Mono" :height 110) 68 (:font "DejaVu Sans Mono" :height 110)
95 (:font "monospace" :height 100)))) 69 (:font "monospace" :height 100)))
96 (acdw/set-first-face-attribute 'default monospace-faces) 70 (variable-pitch-faces
97 (acdw/set-first-face-attribute 'fixed-pitch monospace-faces) 71 '((:font "Comic Neue" :height 125)
72 (:font "Inter" :height 120)
73 (:font "Go" :height 120)
74 (:font "sans-serif"
75 :height 100))))
76 (acdw/set-first-face-attribute 'default
77 fixed-pitch-faces)
78 (acdw/set-first-face-attribute 'fixed-pitch
79 fixed-pitch-faces)
98 (acdw/set-first-face-attribute 'variable-pitch 80 (acdw/set-first-face-attribute 'variable-pitch
99 '((:font "Comic Neue" :height 125) 81 variable-pitch-faces))
100 (:font "Inter" :height 120)
101 (:font "Go" :height 120)
102 (:font "sans-serif"
103 :height 100))))
104 (acdw/set-emoji-fonts "Noto Color Emoji" 82 (acdw/set-emoji-fonts "Noto Color Emoji"
105 "Noto Emoji" 83 "Noto Emoji"
106 "Segoe UI Emoji" 84 "Segoe UI Emoji"
@@ -142,22 +120,7 @@ say, `tool-bar-mode' once to toggle the tool bar back on."
142 120
143;;; Bootstrap package manager (`straight.el') 121;;; Bootstrap package manager (`straight.el')
144 122
145;; 1. Update `exec-path'. 123;; Set `package' and `straight' variables.
146(dolist (path (list (expand-file-name "bin" user-emacs-directory)
147 (expand-file-name "~/bin")
148 (expand-file-name "~/.local/bin")
149 (expand-file-name "~/usr/bin")
150 (expand-file-name "~/cmd")
151 (expand-file-name "~/mingw64/bin")
152 (expand-file-name "~/clisp-2.49"))
153 exec-path)
154 (when (file-exists-p path)
155 (add-to-list 'exec-path path :append)))
156
157;; 1.5. Update $PATH to reflect changes.
158(setenv "PATH" (mapconcat #'identity exec-path path-separator))
159
160;; 2. Set `package' and `straight' variables.
161(setq package-enable-at-startup nil 124(setq package-enable-at-startup nil
162 package-quickstart nil 125 package-quickstart nil
163 straight-host-usernames '((github . "duckwork") 126 straight-host-usernames '((github . "duckwork")
@@ -165,7 +128,7 @@ say, `tool-bar-mode' once to toggle the tool bar back on."
165 straight-base-dir (acdw/dir) 128 straight-base-dir (acdw/dir)
166 straight-check-for-modifications '(check-on-save find-when-checking)) 129 straight-check-for-modifications '(check-on-save find-when-checking))
167 130
168;; 3. Bootstrap `straight'. 131;; Bootstrap `straight'.
169(defvar bootstrap-version) 132(defvar bootstrap-version)
170(let ((bootstrap-file 133(let ((bootstrap-file
171 (expand-file-name 134 (expand-file-name
@@ -206,7 +169,9 @@ say, `tool-bar-mode' once to toggle the tool bar back on."
206;; These packages are here because they need to be loaded /before/ 169;; These packages are here because they need to be loaded /before/
207;; everything else in init.el. 170;; everything else in init.el.
208 171
209(straight-use-package '(setup :host nil :repo "https://git.sr.ht/~pkal/setup")) 172(straight-use-package '(setup
173 :host nil
174 :repo "https://git.sr.ht/~pkal/setup"))
210(require 'setup) 175(require 'setup)
211(require 'acdw-setup) 176(require 'acdw-setup)
212 177