summary refs log tree commit diff stats
path: root/config.org
diff options
context:
space:
mode:
authorAshley Duckworth2021-01-22 13:07:59 -0600
committerAshley Duckworth2021-01-22 13:07:59 -0600
commit679b0c30dc13a813762bae505bef9ac6911e87c4 (patch)
tree24e92c3cbfea10b4d4768d47c0276e0f492748a5 /config.org
parentReorganize early-init and init and add comments (diff)
downloademacs-679b0c30dc13a813762bae505bef9ac6911e87c4.tar.gz
emacs-679b0c30dc13a813762bae505bef9ac6911e87c4.zip
Finally sort out the config.org/el loading thing
Diffstat (limited to 'config.org')
-rw-r--r--config.org35
1 files changed, 23 insertions, 12 deletions
diff --git a/config.org b/config.org index d99c918..8945ab1 100644 --- a/config.org +++ b/config.org
@@ -1559,18 +1559,29 @@ the needed boolean expression to tangle config.org. Booleans, yall!
1559 (config.org (concat config ".org")) 1559 (config.org (concat config ".org"))
1560 (straight-org-dir (expand-file-name "straight/build/org" 1560 (straight-org-dir (expand-file-name "straight/build/org"
1561 user-emacs-directory))) 1561 user-emacs-directory)))
1562 (unless (load config 'no-error)) 1562 ;; Okay, let's figure this out.
1563 ;; A plain require here just loads the older `org' 1563 ;; `and' evaluates each form, and returns nil on the first that
1564 ;; in Emacs' install dir. We need to add the newer 1564 ;; returns nil. `unless' only executes its body if the test
1565 ;; one to the `load-path', hopefully that's all. 1565 ;; returns nil. So.
1566 (when (file-exists-p straight-org-dir) 1566 ;; 1. Test if config.org is newer than config.el. If it is (t), we
1567 (add-to-list 'load-path straight-org-dir)) 1567 ;; *want* to evaluate the body, so we need to negate that test.
1568 ;; Load config.org 1568 ;; 2. Try to load the config. If it errors (nil), it'll bubble that
1569 (require 'org) 1569 ;; to the `and' and the body will be evaluated.
1570 (org-babel-load-file config.org :compile)) 1570 (unless (and (not (file-newer-than-file-p config.org config.el))
1571#+end_src 1571 (load config :noerror))
1572 1572 ;; A plain require here just loads the older `org'
1573*** early-init.el 1573 ;; in Emacs' install dir. We need to add the newer
1574 ;; one to the `load-path', hopefully that's all.
1575 (when (file-exists-p straight-org-dir)
1576 (add-to-list 'load-path straight-org-dir))
1577 ;; Load config.org
1578 (require 'org)
1579 (org-babel-load-file config.org)))
1580
1581 ;;; init.el ends here
1582#+end_src
1583
1584** early-init.el
1574:PROPERTIES: 1585:PROPERTIES:
1575:header-args: :tangle early-init.el :noweb yes 1586:header-args: :tangle early-init.el :noweb yes
1576:END: 1587:END: