2024-07-04 12:21:51 +00:00
|
|
|
;; Paths to config.org and the tangled init.el
|
|
|
|
(defvar org-config-file (expand-file-name "config.org" user-emacs-directory))
|
|
|
|
(defvar tangled-init-file (expand-file-name "init.el" user-emacs-directory))
|
2024-06-25 10:29:32 +00:00
|
|
|
|
2024-07-04 12:21:51 +00:00
|
|
|
;; Function to tangle the org file
|
|
|
|
(defun tangle-org-config ()
|
|
|
|
(require 'org)
|
2024-07-04 12:25:45 +00:00
|
|
|
(org-babel-tangle-file org-config-file)
|
|
|
|
(load tangled-init-file))
|
2024-06-25 10:29:32 +00:00
|
|
|
|
2024-07-04 12:21:51 +00:00
|
|
|
;; Check if config.org is newer than init.el and tangle if necessary
|
|
|
|
(when (file-newer-than-file-p org-config-file tangled-init-file)
|
|
|
|
(tangle-org-config))
|