diff options
Diffstat (limited to 'early-init.el')
-rw-r--r-- | early-init.el | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/early-init.el b/early-init.el index e7595a9..5fd600f 100644 --- a/early-init.el +++ b/early-init.el | |||
@@ -1,47 +1,47 @@ | |||
1 | ;;; early-init.el ~ acdw | 1 | ;;; early-init.el ~ acdw -*- lexical-binding: t; coding: utf-8; fill-column: 85 -*- |
2 | 2 | ||
3 | ;;; this needs to happen first -- speed up init | 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 | ;;; Speed up startup | ||
4 | (setq gc-cons-threshold most-positive-fixnum) | 11 | (setq gc-cons-threshold most-positive-fixnum) |
12 | |||
5 | (defvar file-name-handler-alist-old file-name-handler-alist) | 13 | (defvar file-name-handler-alist-old file-name-handler-alist) |
6 | (setq file-name-handler-alist nil) | 14 | (setq file-name-handler-alist nil) |
15 | |||
7 | (setq message-log-max 16384) | 16 | (setq message-log-max 16384) |
8 | (setq byte-compile-warnings | 17 | (setq byte-compile-warnings |
9 | '(not free-vars unresolved noruntime lexical make-local)) | 18 | '(not free-vars unresolved noruntime lexical make-local)) |
10 | 19 | ||
20 | ;;; Restore stuff after startup | ||
11 | (add-hook 'after-init-hook | 21 | (add-hook 'after-init-hook |
12 | (lambda () | 22 | (lambda () |
13 | (setq file-name-handler-alist file-name-handler-alist-old) | 23 | (setq file-name-handler-alist file-name-handler-alist-old) |
14 | (setq gc-cons-threshold (* 32 1024 1024))) | 24 | (setq gc-cons-threshold (* 32 1024 1024)) |
25 | (garbage-collect)) | ||
15 | t) | 26 | t) |
16 | 27 | ||
17 | ;;(setq debug-on-error t) | 28 | ;; (setq debug-on-error t) |
18 | 29 | ||
19 | ;;; different platforms | 30 | ;;; Define the platforms I work on |
20 | (defconst *acdw/at-work* (eq system-type 'windows-nt)) | 31 | (defconst *acdw/at-work* (eq system-type 'windows-nt)) |
21 | (defconst *acdw/at-larry* (string= (system-name) "larry")) | 32 | (defconst *acdw/at-larry* (string= (system-name) "larry")) |
22 | (defconst *acdw/at-bax* (string= (system-name) "bax")) | 33 | (defconst *acdw/at-bax* (string= (system-name) "bax")) |
23 | (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) | 34 | (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) |
24 | 35 | ||
25 | ;; this needs to be before bootstrapping straight.el | 36 | ;;;; When at work, I have to use Portable Git. |
26 | (when *acdw/at-work* | 37 | (when *acdw/at-work* |
27 | (add-to-list 'exec-path "~/bin") | 38 | (add-to-list 'exec-path "~/bin") |
28 | (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) | 39 | (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) |
29 | 40 | ||
30 | ;;; gui | 41 | ;;; `straight.el' ~ github.com/raxod502/straight.el |
31 | (add-to-list 'default-frame-alist '(tool-bar-lines . 0)) | ||
32 | (add-to-list 'default-frame-alist '(menu-bar-lines . 0)) | ||
33 | |||
34 | (setq inhibit-startup-buffer-menu t) | ||
35 | (setq inhibit-startup-screen t) | ||
36 | (setq initial-buffer-choice t) | ||
37 | (setq initial-scratch-message nil) | ||
38 | 42 | ||
39 | ;;; straight.el ~ github.com/raxod502/straight.el | 43 | ;;;; Bootstrap |
40 | 44 | ;; NOTE: this doesn't work on Windows (download straight directly) | |
41 | (setq straight-use-package-by-default t) ; use use-package | ||
42 | (setq use-package-hook-name-suffix nil) ; don't assume -hook | ||
43 | |||
44 | ;; bootstrap | ||
45 | (defvar bootstrap-version) | 45 | (defvar bootstrap-version) |
46 | (let ((bootstrap-file | 46 | (let ((bootstrap-file |
47 | (expand-file-name "straight/repos/straight.el/bootstrap.el" | 47 | (expand-file-name "straight/repos/straight.el/bootstrap.el" |
@@ -49,12 +49,19 @@ | |||
49 | (bootstrap-version 5)) | 49 | (bootstrap-version 5)) |
50 | (unless (file-exists-p bootstrap-file) | 50 | (unless (file-exists-p bootstrap-file) |
51 | (with-current-buffer | 51 | (with-current-buffer |
52 | (url-retrieve-synchronously | 52 | (url-retrieve-synchronously |
53 | "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" | 53 | "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" |
54 | 'silent 'inhibit-cookies) | 54 | 'silent 'inhibit-cookies) |
55 | (goto-char (point-max)) | 55 | (goto-char (point-max)) |
56 | (eval-print-last-sexp))) | 56 | (eval-print-last-sexp))) |
57 | (load bootstrap-file nil 'nomessage)) | 57 | (load bootstrap-file nil 'nomessage)) |
58 | 58 | ||
59 | ;; install use-package with straight | 59 | ;;; Bootstrap `use-package' |
60 | (setq-default use-package-verbose nil | ||
61 | use-package-expand-minimally t | ||
62 | use-package-enable-imenu-support t | ||
63 | use-package-hook-name-suffix nil) | ||
64 | |||
60 | (straight-use-package 'use-package) | 65 | (straight-use-package 'use-package) |
66 | |||
67 | (setq straight-use-package-by-default t) | ||