diff options
Diffstat (limited to 'early-init.el')
-rw-r--r-- | early-init.el | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/early-init.el b/early-init.el index d803c89..4037ef8 100644 --- a/early-init.el +++ b/early-init.el | |||
@@ -47,7 +47,7 @@ | |||
47 | "Reset `gc-cons-threshold', `gc-cons-percentage', and | 47 | "Reset `gc-cons-threshold', `gc-cons-percentage', and |
48 | `file-name-handler-alist' to their defaults after init." | 48 | `file-name-handler-alist' to their defaults after init." |
49 | (setq gc-cons-threshold gc-cons-threshold-basis | 49 | (setq gc-cons-threshold gc-cons-threshold-basis |
50 | gc-cons-percentage gc-cons-percentage-basis) | 50 | gc-cons-percentage gc-cons-percentage-basis) |
51 | (dolist (handler file-name-handler-alist) | 51 | (dolist (handler file-name-handler-alist) |
52 | (add-to-list 'orig-file-name-handler-alist handler)) | 52 | (add-to-list 'orig-file-name-handler-alist handler)) |
53 | (setq file-name-handler-alist orig-file-name-handler-alist)) | 53 | (setq file-name-handler-alist orig-file-name-handler-alist)) |
@@ -58,33 +58,33 @@ | |||
58 | 58 | ||
59 | (setq default-frame-alist ; Remove most UI | 59 | (setq default-frame-alist ; Remove most UI |
60 | `((tool-bar-lines . 0) ; No tool bar | 60 | `((tool-bar-lines . 0) ; No tool bar |
61 | (menu-bar-lines . 0) ; No menu bar | 61 | (menu-bar-lines . 0) ; No menu bar |
62 | (vertical-scroll-bars) ; No scroll bars | 62 | (vertical-scroll-bars) ; No scroll bars |
63 | (horizontal-scroll-bars) ; ... at all | 63 | (horizontal-scroll-bars) ; ... at all |
64 | (width . 84) ; A /little/ wider than | 64 | (width . 84) ; A /little/ wider than |
65 | ; `fill-column' (set later) | 65 | ; `fill-column' (set later) |
66 | (height . 30) | 66 | (height . 30) |
67 | (left-fringe . 8) ; Width of fringes | 67 | (left-fringe . 8) ; Width of fringes |
68 | (right-fringe . 8) ; (8 is default) | 68 | (right-fringe . 8) ; (8 is default) |
69 | (font . ,(pcase acdw/system | 69 | (font . ,(pcase acdw/system |
70 | (:home "DejaVu Sans Mono 10") | 70 | (:home "DejaVu Sans Mono 10") |
71 | (:work "Consolas 10")))) | 71 | (:work "Consolas 10")))) |
72 | frame-inhibit-implied-resize t ; Don't resize randomly | 72 | frame-inhibit-implied-resize t ; Don't resize randomly |
73 | frame-resize-pixelwise t ; Resize by pixels, not chars | 73 | frame-resize-pixelwise t ; Resize by pixels, not chars |
74 | ) | 74 | ) |
75 | 75 | ||
76 | (defun hook--disable-ui-modes () | 76 | (defun hook--disable-ui-modes () |
77 | "Disable frame UI using modes, for toggling later." | 77 | "Disable frame UI using modes, for toggling later." |
78 | (dolist (mode ;; each mode is of the form (MODE . FRAME-ALIST-VAR) | 78 | (dolist (mode ;; each mode is of the form (MODE . FRAME-ALIST-VAR) |
79 | '((tool-bar-mode . tool-bar-lines) | 79 | '((tool-bar-mode . tool-bar-lines) |
80 | (menu-bar-mode . menu-bar-lines) | 80 | (menu-bar-mode . menu-bar-lines) |
81 | (scroll-bar-mode . vertical-scroll-bars) | 81 | (scroll-bar-mode . vertical-scroll-bars) |
82 | (horizontal-scroll-bar-mode . horizontal-scroll-bars) | 82 | (horizontal-scroll-bar-mode . horizontal-scroll-bars) |
83 | )) | 83 | )) |
84 | (let ((setting (alist-get (cdr mode) default-frame-alist))) | 84 | (let ((setting (alist-get (cdr mode) default-frame-alist))) |
85 | (when (or (not setting) | 85 | (when (or (not setting) |
86 | (= 0 setting)) | 86 | (= 0 setting)) |
87 | (funcall (car mode) -1))))) | 87 | (funcall (car mode) -1))))) |
88 | 88 | ||
89 | (add-hook 'after-init-hook #'hook--disable-ui-modes) | 89 | (add-hook 'after-init-hook #'hook--disable-ui-modes) |
90 | 90 | ||
@@ -92,11 +92,11 @@ | |||
92 | 92 | ||
93 | ;; 1. Update `exec-path'. | 93 | ;; 1. Update `exec-path'. |
94 | (dolist (path (list (expand-file-name "bin" user-emacs-directory) | 94 | (dolist (path (list (expand-file-name "bin" user-emacs-directory) |
95 | (expand-file-name "~/bin") | 95 | (expand-file-name "~/bin") |
96 | (expand-file-name "~/.local/bin") | 96 | (expand-file-name "~/.local/bin") |
97 | (expand-file-name "~/usr/bin") | 97 | (expand-file-name "~/usr/bin") |
98 | (expand-file-name "~/cmd") | 98 | (expand-file-name "~/cmd") |
99 | (expand-file-name "~/mingw64/bin"))) | 99 | (expand-file-name "~/mingw64/bin"))) |
100 | (when (file-exists-p path) | 100 | (when (file-exists-p path) |
101 | (add-to-list 'exec-path path :append))) | 101 | (add-to-list 'exec-path path :append))) |
102 | 102 | ||
@@ -105,10 +105,10 @@ | |||
105 | 105 | ||
106 | ;; 2. Set `package' and `straight' variables. | 106 | ;; 2. Set `package' and `straight' variables. |
107 | (setq package-enable-at-startup nil ; not sure if strictly | 107 | (setq package-enable-at-startup nil ; not sure if strictly |
108 | ; necessary | 108 | ; necessary |
109 | package-quickstart nil ; ditto | 109 | package-quickstart nil ; ditto |
110 | straight-host-usernames '((github . "duckwork") | 110 | straight-host-usernames '((github . "duckwork") |
111 | (gitlab . "acdw")) | 111 | (gitlab . "acdw")) |
112 | straight-base-dir acdw/dir ; don't clutter ~/.emacs.d | 112 | straight-base-dir acdw/dir ; don't clutter ~/.emacs.d |
113 | ) | 113 | ) |
114 | 114 | ||
@@ -116,15 +116,15 @@ | |||
116 | (defvar bootstrap-version) | 116 | (defvar bootstrap-version) |
117 | (let ((bootstrap-file | 117 | (let ((bootstrap-file |
118 | (expand-file-name | 118 | (expand-file-name |
119 | "straight/repos/straight.el/bootstrap.el" | 119 | "straight/repos/straight.el/bootstrap.el" |
120 | straight-base-dir)) | 120 | straight-base-dir)) |
121 | (bootstrap-version 5)) | 121 | (bootstrap-version 5)) |
122 | (unless (file-exists-p bootstrap-file) | 122 | (unless (file-exists-p bootstrap-file) |
123 | (with-current-buffer | 123 | (with-current-buffer |
124 | (url-retrieve-synchronously | 124 | (url-retrieve-synchronously |
125 | (concat "https://raw.githubusercontent.com/" | 125 | (concat "https://raw.githubusercontent.com/" |
126 | "raxod502/straight.el/develop/install.el") | 126 | "raxod502/straight.el/develop/install.el") |
127 | 'silent 'inhibit-cookies) | 127 | 'silent 'inhibit-cookies) |
128 | (goto-char (point-max)) | 128 | (goto-char (point-max)) |
129 | (eval-print-last-sexp))) | 129 | (eval-print-last-sexp))) |
130 | (load bootstrap-file nil 'nomessage)) | 130 | (load bootstrap-file nil 'nomessage)) |
@@ -134,10 +134,10 @@ | |||
134 | (defun hook--message-startup-time () | 134 | (defun hook--message-startup-time () |
135 | "Show Emacs's startup time in the message buffer. For profiling." | 135 | "Show Emacs's startup time in the message buffer. For profiling." |
136 | (message "Emacs ready in %s with %d garbage collections." | 136 | (message "Emacs ready in %s with %d garbage collections." |
137 | (format "%.2f seconds" | 137 | (format "%.2f seconds" |
138 | (float-time (time-subtract after-init-time | 138 | (float-time (time-subtract after-init-time |
139 | before-init-time))) | 139 | before-init-time))) |
140 | gcs-done)) | 140 | gcs-done)) |
141 | 141 | ||
142 | (add-hook 'emacs-startup-hook #'hook--message-startup-time) | 142 | (add-hook 'emacs-startup-hook #'hook--message-startup-time) |
143 | 143 | ||