diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/init.el b/init.el index a0e072f..7cf9f7a 100644 --- a/init.el +++ b/init.el | |||
@@ -1,51 +1,51 @@ | |||
1 | ;;; init.el -*- lexical-binding: t; coding: utf-8 -*- | 1 | ;;; init.el -*- lexical-binding: t; coding: utf-8 -*- |
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 | (message "%s..." "Loading init.el") | 19 | (message "%s..." "Loading init.el") |
20 | (let* (;; Speed up init | 20 | (let* (;; Speed up init |
21 | (gc-cons-threshold most-positive-fixnum) | 21 | (gc-cons-threshold most-positive-fixnum) |
22 | ;; (gc-cons-percentage 0.6) | 22 | ;; (gc-cons-percentage 0.6) |
23 | (file-name-handler-alist nil) | 23 | (file-name-handler-alist nil) |
24 | ;; Config file names | 24 | ;; Config file names |
25 | (config (expand-file-name "config" | 25 | (config (expand-file-name "config" |
26 | user-emacs-directory)) | 26 | user-emacs-directory)) |
27 | (config.el (concat config ".el")) | 27 | (config.el (concat config ".el")) |
28 | (config.org (concat config ".org")) | 28 | (config.org (concat config ".org")) |
29 | (straight-org-dir (locate-user-emacs-file "straight/build/org"))) | 29 | (straight-org-dir (locate-user-emacs-file "straight/build/org"))) |
30 | ;; Okay, let's figure this out. | 30 | ;; Okay, let's figure this out. |
31 | ;; `and' evaluates each form, and returns nil on the first that | 31 | ;; `and' evaluates each form, and returns nil on the first that |
32 | ;; returns nil. `unless' only executes its body if the test | 32 | ;; returns nil. `unless' only executes its body if the test |
33 | ;; returns nil. So. | 33 | ;; returns nil. So. |
34 | ;; 1. Test if config.org is newer than config.el. If it is (t), we | 34 | ;; 1. Test if config.org is newer than config.el. If it is (t), we |
35 | ;; *want* to evaluate the body, so we need to negate that test. | 35 | ;; *want* to evaluate the body, so we need to negate that test. |
36 | ;; 2. Try to load the config. If it errors (nil), it'll bubble that | 36 | ;; 2. Try to load the config. If it errors (nil), it'll bubble that |
37 | ;; to the `and' and the body will be evaluated. | 37 | ;; to the `and' and the body will be evaluated. |
38 | (unless (and (not (file-newer-than-file-p config.org config.el)) | 38 | (unless (and (not (file-newer-than-file-p config.org config.el)) |
39 | (load config :noerror)) | 39 | (load config :noerror)) |
40 | ;; A plain require here just loads the older `org' | 40 | ;; A plain require here just loads the older `org' |
41 | ;; in Emacs' install dir. We need to add the newer | 41 | ;; in Emacs' install dir. We need to add the newer |
42 | ;; one to the `load-path', hopefully that's all. | 42 | ;; one to the `load-path', hopefully that's all. |
43 | (when (file-exists-p straight-org-dir) | 43 | (when (file-exists-p straight-org-dir) |
44 | (add-to-list 'load-path straight-org-dir)) | 44 | (add-to-list 'load-path straight-org-dir)) |
45 | ;; Load config.org | 45 | ;; Load config.org |
46 | (message "%s..." "Loading config.org") | 46 | (message "%s..." "Loading config.org") |
47 | (require 'org) | 47 | (require 'org) |
48 | (org-babel-load-file config.org) | 48 | (org-babel-load-file config.org) |
49 | (message "%s... Done" "Loading config.org"))) | 49 | (message "%s... Done" "Loading config.org"))) |
50 | (message "%s... Done." "Loading init.el") | 50 | (message "%s... Done." "Loading init.el") |
51 | ;;; init.el ends here | 51 | ;;; init.el ends here |