diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/init.el b/init.el index d0e30b2..e8a67fd 100644 --- a/init.el +++ b/init.el | |||
@@ -2,36 +2,28 @@ | |||
2 | ;; This file is automatically tangled from config.org. | 2 | ;; This file is automatically tangled from config.org. |
3 | ;; Hand edits will be overwritten! | 3 | ;; Hand edits will be overwritten! |
4 | 4 | ||
5 | ;; Prefer newer files to older files | 5 | (setq-default load-prefer-newer t) |
6 | 6 | ||
7 | |||
8 | ;; [[file:~/.emacs.d/config.org::*Prefer newer files to older files][Prefer newer files to older files:1]] | ||
9 | (setq load-prefer-newer t) | ||
10 | ;; Prefer newer files to older files:1 ends here | ||
11 | |||
12 | ;; Load the config | ||
13 | |||
14 | ;; I keep most of my config in =config.el=, which is tangled directly | ||
15 | ;; from this file. This init just loads that file, either from lisp or | ||
16 | ;; directly from Org if it's newer. | ||
17 | |||
18 | |||
19 | ;; [[file:~/.emacs.d/config.org::*Load the config][Load the config:1]] | ||
20 | (let* (;; Speed up init | 7 | (let* (;; Speed up init |
21 | (gc-cons-threshold most-positive-fixnum) | 8 | (gc-cons-threshold most-positive-fixnum) |
22 | (file-name-handler-alist nil) | 9 | (file-name-handler-alist nil) |
23 | ;; Config file names | 10 | ;; Config file names |
24 | (conf (expand-file-name "config" | 11 | (config (expand-file-name "config" |
25 | user-emacs-directory)) | 12 | user-emacs-directory)) |
26 | (conf-el (concat conf ".el")) | 13 | (config.el (concat config ".el")) |
27 | (conf-org (concat conf ".org"))) | 14 | (config.org (concat config ".org")) |
28 | (unless (and (file-newer-than-file-p conf-el conf-org) | 15 | (straight-org-dir (expand-file-name "straight/build/org" |
29 | (load conf 'no-error)) | 16 | user-emacs-directory))) |
30 | ;; A plain require here just loads the older `org' | 17 | ;; Unless config.org is /newer/ than config.el, *or* the config |
31 | ;; in Emacs' install dir. We need to add the newer | 18 | ;; is able to be loaded without errors, load the config from |
32 | ;; one to the `load-path', hopefully that's all. | 19 | ;; config.org. |
33 | (add-to-list 'load-path (expand-file-name "straight/build/org" | 20 | (unless (or (file-newer-than-file-p config.org config.el) |
34 | user-emacs-directory)) | 21 | (load config 'no-error)) |
35 | (require 'org) | 22 | ;; A plain require here just loads the older `org' |
36 | (org-babel-load-file conf-org))) | 23 | ;; in Emacs' install dir. We need to add the newer |
37 | ;; Load the config:1 ends here | 24 | ;; one to the `load-path', hopefully that's all. |
25 | (when (file-exists-p straight-org-dir) | ||
26 | (add-to-list 'load-path straight-org-dir)) | ||
27 | ;; Load config.org | ||
28 | (require 'org) | ||
29 | (org-babel-load-file config.org))) | ||