summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el100
1 files changed, 50 insertions, 50 deletions
diff --git a/init.el b/init.el index 2fdd1c9..0d48e0d 100644 --- a/init.el +++ b/init.el
@@ -1,50 +1,50 @@
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(let* (;; Speed up init 19(let* (;; Speed up init
20 (gc-cons-threshold most-positive-fixnum) 20 (gc-cons-threshold most-positive-fixnum)
21 ;; (gc-cons-percentage 0.6) 21 ;; (gc-cons-percentage 0.6)
22 (file-name-handler-alist nil) 22 (file-name-handler-alist nil)
23 ;; Config file names 23 ;; Config file names
24 (config (expand-file-name "config" 24 (config (expand-file-name "config"
25 user-emacs-directory)) 25 user-emacs-directory))
26 (config.el (concat config ".el")) 26 (config.el (concat config ".el"))
27 (config.org (concat config ".org")) 27 (config.org (concat config ".org"))
28 (straight-org-dir (locate-user-emacs-file "straight/build/org"))) 28 (straight-org-dir (locate-user-emacs-file "straight/build/org")))
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 (message "%s..." "Loading config.org") 45 (message "%s..." "Loading config.org")
46 (require 'org) 46 (require 'org)
47 (org-babel-load-file config.org) 47 (org-babel-load-file config.org)
48 (message "%s... Done" "Loading config.org"))) 48 (message "%s... Done" "Loading config.org")))
49 49
50;;; init.el ends here 50;;; init.el ends here