diff options
author | Case Duckworth | 2020-09-22 20:16:01 -0500 |
---|---|---|
committer | Case Duckworth | 2020-09-22 20:16:01 -0500 |
commit | c64216002b685cce810b3ba23eed6e4337b73dae (patch) | |
tree | 64860475168cfdc81f80f17f4c0614e94ee562ac /early-init.el | |
parent | Add visual-fill-column to elpher-mode-hook (diff) | |
download | emacs-c64216002b685cce810b3ba23eed6e4337b73dae.tar.gz emacs-c64216002b685cce810b3ba23eed6e4337b73dae.zip |
Rewrite to take advantage of outshine-mode
Diffstat (limited to 'early-init.el')
-rw-r--r-- | early-init.el | 127 |
1 files changed, 67 insertions, 60 deletions
diff --git a/early-init.el b/early-init.el index e7595a9..c67eadb 100644 --- a/early-init.el +++ b/early-init.el | |||
@@ -1,60 +1,67 @@ | |||
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 | (setq gc-cons-threshold most-positive-fixnum) | 4 | ;; `early-init.el' is new as of Emacs 27.1. It contains ... /early initiation/. |
5 | (defvar file-name-handler-alist-old file-name-handler-alist) | 5 | ;; What does that mean? Who knows. What I /do know/ is that it runs /before/ |
6 | (setq file-name-handler-alist nil) | 6 | ;; `package.el' is loaded, so I can stop it from loading, since I use `straight.el'. |
7 | (setq message-log-max 16384) | 7 | ;; Other than that, there's some other init stuff that needs to happen as early |
8 | (setq byte-compile-warnings | 8 | ;; as possible -- think bootstrap-level. |
9 | '(not free-vars unresolved noruntime lexical make-local)) | 9 | |
10 | 10 | ;;; Speed up startup | |
11 | (add-hook 'after-init-hook | 11 | (setq gc-cons-threshold most-positive-fixnum) |
12 | (lambda () | 12 | |
13 | (setq file-name-handler-alist file-name-handler-alist-old) | 13 | (defvar file-name-handler-alist-old file-name-handler-alist) |
14 | (setq gc-cons-threshold (* 32 1024 1024))) | 14 | (setq file-name-handler-alist nil) |
15 | t) | 15 | |
16 | 16 | (setq message-log-max 16384) | |
17 | ;;(setq debug-on-error t) | 17 | (setq byte-compile-warnings |
18 | 18 | '(not free-vars unresolved noruntime lexical make-local)) | |
19 | ;;; different platforms | 19 | |
20 | (defconst *acdw/at-work* (eq system-type 'windows-nt)) | 20 | ;;; Restore stuff after startup |
21 | (defconst *acdw/at-larry* (string= (system-name) "larry")) | 21 | (add-hook 'after-init-hook |
22 | (defconst *acdw/at-bax* (string= (system-name) "bax")) | 22 | (lambda () |
23 | (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) | 23 | (setq file-name-handler-alist file-name-handler-alist-old) |
24 | 24 | (setq gc-cons-threshold (* 32 1024 1024)) | |
25 | ;; this needs to be before bootstrapping straight.el | 25 | (garbage-collect)) |
26 | (when *acdw/at-work* | 26 | t) |
27 | (add-to-list 'exec-path "~/bin") | 27 | |
28 | (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) | 28 | ;; (setq debug-on-error t) |
29 | 29 | ||
30 | ;;; gui | 30 | ;;; Define the platforms I work on |
31 | (add-to-list 'default-frame-alist '(tool-bar-lines . 0)) | 31 | (defconst *acdw/at-work* (eq system-type 'windows-nt)) |
32 | (add-to-list 'default-frame-alist '(menu-bar-lines . 0)) | 32 | (defconst *acdw/at-larry* (string= (system-name) "larry")) |
33 | 33 | (defconst *acdw/at-bax* (string= (system-name) "bax")) | |
34 | (setq inhibit-startup-buffer-menu t) | 34 | (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) |
35 | (setq inhibit-startup-screen t) | 35 | |
36 | (setq initial-buffer-choice t) | 36 | ;;;; When at work, I have to use Portable Git. |
37 | (setq initial-scratch-message nil) | 37 | (when *acdw/at-work* |
38 | 38 | (add-to-list 'exec-path "~/bin") | |
39 | ;;; straight.el ~ github.com/raxod502/straight.el | 39 | (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) |
40 | 40 | ||
41 | (setq straight-use-package-by-default t) ; use use-package | 41 | ;;; `straight.el' ~ github.com/raxod502/straight.el |
42 | (setq use-package-hook-name-suffix nil) ; don't assume -hook | 42 | |
43 | 43 | ;;;; Bootstrap | |
44 | ;; bootstrap | 44 | ;; NOTE: this doesn't work on Windows (download straight directly) |
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" |
48 | user-emacs-directory)) | 48 | user-emacs-directory)) |
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 | (straight-use-package '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 | |||
65 | (straight-use-package 'use-package) | ||
66 | |||
67 | (setq straight-use-package-by-default t) | ||