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.el61
1 files changed, 6 insertions, 55 deletions
diff --git a/early-init.el b/early-init.el index b0314ae..5e9d585 100644 --- a/early-init.el +++ b/early-init.el
@@ -1,72 +1,23 @@
1;;; early-init.el ~ acdw -*- lexical-binding: t; no-byte-compile: t -*- 1;;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*-
2
3;;; Commentary:
4;; `early-init.el' is new as of Emacs 27.1. It contains ... /early initiation/.
5;; What does that mean? Who knows. What I /do know/ is that it runs /before/
6;; `package.el' is loaded, so I can stop it from loading, since I use `straight.el'.
7;; Other than that, there's some other init stuff that needs to happen as early
8;; as possible -- think bootstrap-level.
9
10;;; Settings
11
12;; (setq debug-on-error t)
13 2
14(setq load-prefer-newer t) 3(setq load-prefer-newer t)
15 4
16;;; Speed up startup 5;;; Bootstrap `straight.el'
17(setq gc-cons-threshold most-positive-fixnum)
18(defconst *acdw/gc-cons* 800000 "'Regular' garbage collection amount")
19
20(defvar file-name-handler-alist-old file-name-handler-alist)
21(setq file-name-handler-alist nil)
22
23(setq message-log-max 16384)
24(setq byte-compile-warnings
25 '(not free-vars unresolved noruntime lexical make-local))
26
27;;; Restore stuff after startup
28(add-hook 'after-init-hook
29 (lambda ()
30 (setq file-name-handler-alist file-name-handler-alist-old)
31 (setq gc-cons-threshold *acdw/gc-cons*)
32 (garbage-collect))
33 t)
34
35;;; Define the platforms I work on
36(defconst *acdw/at-work* (eq system-type 'windows-nt))
37(defconst *acdw/at-larry* (string= (system-name) "larry"))
38(defconst *acdw/at-bax* (string= (system-name) "bax"))
39(defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*))
40
41;;;; When at work, I have to use Portable Git.
42(when *acdw/at-work*
43 (add-to-list 'exec-path "~/bin")
44 (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin"))
45
46;;; `straight.el' ~ github.com/raxod502/straight.el
47
48;;;; Bootstrap
49;; NOTE: this doesn't work on Windows (download straight directly)
50(defvar bootstrap-version) 6(defvar bootstrap-version)
51(let ((bootstrap-file 7(let ((bootstrap-file
52 (expand-file-name "straight/repos/straight.el/bootstrap.el" 8 (expand-file-name "straight/repos/straight.el/bootstrap.el"
53 user-emacs-directory)) 9 user-emacs-directory))
54 (bootstrap-version 5)) 10 (bootstrap-version 5))
55 (unless (file-exists-p bootstrap-file) 11 (unless (file-exists-p bootstrap-file)
56 (with-current-buffer 12 (with-current-buffer
57 (url-retrieve-synchronously 13 (url-retrieve-synchronously
58 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 14 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
59 'silent 'inhibit-cookies) 15 'silent 'inhibit-cookies)
60 (goto-char (point-max)) 16 (goto-char (point-max))
61 (eval-print-last-sexp))) 17 (eval-print-last-sexp)))
62 (load bootstrap-file nil 'nomessage)) 18 (load bootstrap-file nil 'nomessage))
63 19
64;;; Bootstrap `use-package' 20;;; Bootstrap `use-package'
65(setq-default use-package-verbose nil
66 use-package-expand-minimally t
67 use-package-enable-imenu-support t
68 use-package-hook-name-suffix nil)
69
70(straight-use-package 'use-package) 21(straight-use-package 'use-package)
71 22
72(setq straight-use-package-by-default t) 23(setq straight-use-package-by-default t)