diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/init.el b/init.el index 2fdadb6..1ddb5f9 100644 --- a/init.el +++ b/init.el | |||
@@ -1,48 +1,48 @@ | |||
1 | ;;; init.el -*- lexical-binding: t -*- | 1 | ;;; init.el -*- lexical-binding: t -*- |
2 | ;; Copyright (C) 2020 Case Duckworth | 2 | ;; Copyright (C) 2020 Case Duckworth |
3 | 3 | ||
4 | ;; Author: Case Duckworth <acdw@acdw.net> | 4 | ;; Author: Case Duckworth <acdw@acdw.net> |
5 | ;; Created: Sometime during the Covid-19 lockdown, 2019 | 5 | ;; Created: Sometime during the Covid-19 lockdown, 2019 |
6 | ;; Keywords: configuration | 6 | ;; Keywords: configuration |
7 | ;; URL: https://tildegit.org/acdw/emacs | 7 | ;; URL: https://tildegit.org/acdw/emacs |
8 | 8 | ||
9 | ;; This file is not part of GNU Emacs. | 9 | ;; This file is not part of GNU Emacs. |
10 | 10 | ||
11 | ;;; Commentary: | 11 | ;;; Commentary: |
12 | ;; This file is automatically tangled from config.org. | 12 | ;; This file is automatically tangled from config.org. |
13 | ;; Hand edits will be overwritten! | 13 | ;; Hand edits will be overwritten! |
14 | 14 | ||
15 | ;;; Code: | 15 | ;;; Code: |
16 | 16 | ||
17 | (setq-default load-prefer-newer t) | 17 | (setq-default load-prefer-newer t) |
18 | 18 | ||
19 | (let* (;; Speed up init | 19 | (let* (;; Speed up init |
20 | (gc-cons-threshold most-positive-fixnum) | 20 | (gc-cons-threshold most-positive-fixnum) |
21 | (file-name-handler-alist nil) | 21 | (file-name-handler-alist nil) |
22 | ;; Config file names | 22 | ;; Config file names |
23 | (config (expand-file-name "config" | 23 | (config (expand-file-name "config" |
24 | user-emacs-directory)) | 24 | user-emacs-directory)) |
25 | (config.el (concat config ".el")) | 25 | (config.el (concat config ".el")) |
26 | (config.org (concat config ".org")) | 26 | (config.org (concat config ".org")) |
27 | (straight-org-dir (expand-file-name "straight/build/org" | 27 | (straight-org-dir (expand-file-name "straight/build/org" |
28 | user-emacs-directory))) | 28 | user-emacs-directory))) |
29 | ;; Okay, let's figure this out. | 29 | ;; Okay, let's figure this out. |
30 | ;; `and' evaluates each form, and returns nil on the first that | 30 | ;; `and' evaluates each form, and returns nil on the first that |
31 | ;; returns nil. `unless' only executes its body if the test | 31 | ;; returns nil. `unless' only executes its body if the test |
32 | ;; returns nil. So. | 32 | ;; returns nil. So. |
33 | ;; 1. Test if config.org is newer than config.el. If it is (t), we | 33 | ;; 1. Test if config.org is newer than config.el. If it is (t), we |
34 | ;; *want* to evaluate the body, so we need to negate that test. | 34 | ;; *want* to evaluate the body, so we need to negate that test. |
35 | ;; 2. Try to load the config. If it errors (nil), it'll bubble that | 35 | ;; 2. Try to load the config. If it errors (nil), it'll bubble that |
36 | ;; to the `and' and the body will be evaluated. | 36 | ;; to the `and' and the body will be evaluated. |
37 | (unless (and (not (file-newer-than-file-p config.org config.el)) | 37 | (unless (and (not (file-newer-than-file-p config.org config.el)) |
38 | (load config :noerror)) | 38 | (load config :noerror)) |
39 | ;; A plain require here just loads the older `org' | 39 | ;; A plain require here just loads the older `org' |
40 | ;; in Emacs' install dir. We need to add the newer | 40 | ;; in Emacs' install dir. We need to add the newer |
41 | ;; one to the `load-path', hopefully that's all. | 41 | ;; one to the `load-path', hopefully that's all. |
42 | (when (file-exists-p straight-org-dir) | 42 | (when (file-exists-p straight-org-dir) |
43 | (add-to-list 'load-path straight-org-dir)) | 43 | (add-to-list 'load-path straight-org-dir)) |
44 | ;; Load config.org | 44 | ;; Load config.org |
45 | (require 'org) | 45 | (require 'org) |
46 | (org-babel-load-file config.org))) | 46 | (org-babel-load-file config.org))) |
47 | 47 | ||
48 | ;;; init.el ends here | 48 | ;;; init.el ends here |