-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.el
executable file
·55 lines (51 loc) · 2.12 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
;;; init.el --- emacs initialization file
;; -*- lexical-binding: t; -*-
;; Copyright (C) 2017-2018 Adam Taylor
;;; Commentary:
;; This init file is used to load up the literate configuration that resides
;; in the `my/cfg-file`.org file. This is babel'd into a .el file that is then
;; loaded as the configuration.
;;
;; The code here simply:
;; 1. Disables the package system (using straight speeds up Emacs start quite a bit)
;; 2. Loads the custom file before anything else (to properly customize variables)
;; 3. Bootstraps the straight package system (and sets some variables)
;; 4. Loads the literate configuration
;;
;;; Code:
;; Don't use package subsystem (1)
(setq package-enable-at-startup nil)
;; Load custom-file first (2)
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file t)
;; Bootstrap straight (3)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; Use-package as the package configuration tool of choice
(straight-use-package 'use-package)
;; Force use-package to use straight.el to automatically install missing packages
(setq straight-use-package-by-default t)
;; Make sure we have org for the org-babel-tangle-file below
(use-package org)
;; Load my config file (4)
(defcustom my/cfg-file (concat user-emacs-directory "README")
"The base name for the .org file to use for Emacs initialization."
:group 'my-configuration
:type 'string)
(when (file-newer-than-file-p (concat my/cfg-file ".org") (concat my/cfg-file ".el"))
(org-babel-tangle-file (concat my/cfg-file ".org")))
(load my/cfg-file)
;; Local Variables:
;; byte-compile-warnings: (not free-vars noruntime)
;; End:
;;; init.el ends here