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.el86
1 files changed, 18 insertions, 68 deletions
diff --git a/early-init.el b/early-init.el index b841ea5..3dd74e0 100644 --- a/early-init.el +++ b/early-init.el
@@ -1,50 +1,14 @@
1;;; early-init.el --- Emacs early init -*- lexical-binding: t -*- 1;;; early-init.el -*- lexical-binding: t -*-
2 2
3;; by C. Duckworth <acdw@acdw.net> 3;; Bankruptcy: 9.4
4 4
5;; Bankruptcy: 9.3 5;; Debugging shit
6 6(setq debug-on-error t
7;;; Debugging --- delete this when done bankrupting
8(setf debug-on-error t
9 use-package-verbose t) 7 use-package-verbose t)
10 8
11;;; Speedy startup 9;; Frames
12 10(setq default-frame-alist '((tool-bar-lines . 0)
13(defvar +emacs--startup-restore-alist nil 11 ;; (menu-bar-lines . 0)
14 "Variables to restore after startup.")
15
16(defun +emacs-startup@restore-variables ()
17 "Restore variables set temporarily during startup."
18 (dolist (v +emacs--startup-restore-alist)
19 (set-default (car v) (cdr v))))
20(add-hook 'after-init-hook #'+emacs-startup@restore-variables)
21
22(defun +set-during-startup (variable value &optional restore)
23 "Set VARIABLE to VALUE during startup.
24If RESTORE is non-nil, restore the variable's value to it.
25Otherwise, save its original value and restore to that."
26 (unless after-init-time
27 (setf (alist-get variable +emacs--startup-restore-alist)
28 (or restore (symbol-value variable)))
29 (set-default variable value)))
30
31(+set-during-startup 'gc-cons-threshold most-positive-fixnum)
32
33;;; Distraction-free startup
34
35(unless debug-on-error
36 (+set-during-startup 'inhibit-redisplay t)
37 (+set-during-startup 'inhibit-message t))
38
39(setf warning-minimum-level :emergency)
40(add-hook 'emacs-startup-hook
41 (defun +message-about-warnings ()
42 (when-let ((warnings (get-buffer "*Warnings*")))
43 (message "%s. %s." "There were init-time warnings"
44 "See the `*Warnings*' buffer."))))
45
46(setf default-frame-alist '((tool-bar-lines . 0)
47 (menu-bar-lines . 0)
48 (vertical-scroll-bars . nil) 12 (vertical-scroll-bars . nil)
49 (horizontal-scroll-bars . nil)) 13 (horizontal-scroll-bars . nil))
50 frame-inhibit-implied-resize t 14 frame-inhibit-implied-resize t
@@ -54,42 +18,28 @@ Otherwise, save its original value and restore to that."
54 indicate-empty-lines nil 18 indicate-empty-lines nil
55 indicate-buffer-boundaries nil) 19 indicate-buffer-boundaries nil)
56 20
57;;; Packages 21;; Packages
58
59(require 'package) 22(require 'package)
60 23(add-to-list 'package-archives
61(dolist (archive 24 '("melpa" . "https://melpa.org/packages/")
62 '(("gnu-devel" . "https://elpa.gnu.org/devel/") 25 :append)
63 ("nongnu-devel" . "https://elpa.gnu.org/nongnu-devel/") 26(setq package-priorities '(("melpa" . 2)
64 ("melpa" . "https://melpa.org/packages/"))) 27 ("nongnu" . 1)
65 (add-to-list 'package-archives archive :append)) 28 ("gnu" . 0)))
66
67(setf package-archive-priorities
68 '(("gnu-devel" . 2)
69 ("nongnu-devel" . 1)
70 ("melpa" . 0)
71 ("gnu" . 0)
72 ("nongnu" . 0)))
73
74(package-initialize) 29(package-initialize)
75
76(unless package-archive-contents 30(unless package-archive-contents
77 (package-refresh-contents)) 31 (package-refresh-contents))
78 32
79;; https://melpa.org/packages/archive-contents 33(setq use-package-enable-imenu-support t
80
81;;; Use-package
82
83(setf use-package-enable-imenu-support t
84 use-package-hook-name-suffix nil) 34 use-package-hook-name-suffix nil)
85 35
86(require 'use-package) 36(require 'use-package)
87 37(setq use-package-compute-statistics debug-on-error)
88(setf use-package-compute-statistics debug-on-error)
89 38
90(use-package use-package-vc 39(use-package use-package-vc
91 :load-path "~/src/emacs/use-package-vc.el" 40 :load-path "~/src/emacs/use-package-vc.el/"
92 :config 41 :config
93 (define-advice package-vc-install (:around (orig &rest args) wtf) 42 (define-advice package-vc-install (:around (orig &rest args) wtf)
43 "Don't freak out about `package-archives' shit."
94 (let ((package-archives nil)) 44 (let ((package-archives nil))
95 (apply orig args)))) 45 (apply orig args))))