Load org-config preface on direct load

This commit is contained in:
2026-02-04 00:25:49 -08:00
parent 5c3c55c582
commit 56c9ddf508

View File

@@ -30,13 +30,20 @@ We're going to use this to write separate parts of our config to different secti
#+end_src #+end_src
* My Customization Variables * My Customization Variables
#+begin_src emacs-lisp :tangle org-config.el #+begin_src emacs-lisp :tangle org-config.el
;; Ensure core org variables exist even when org-config.el is loaded directly. ;; Load org-config-preface when org-config.el is loaded directly.
(defvar imalison:org-dir "~/org") (let ((preface (expand-file-name "org-config-preface.el" user-emacs-directory)))
(when (file-exists-p preface)
(load-file preface)))
;; Fallbacks in case preface isn't available yet.
(unless (boundp 'imalison:org-dir)
(defvar imalison:org-dir "~/org"))
(unless (boundp 'imalison:created-property-string)
(defvar imalison:created-property-string " (defvar imalison:created-property-string "
:PROPERTIES: :PROPERTIES:
:ID: %(org-id-new) :ID: %(org-id-new)
:CREATED: %U :CREATED: %U
:END:") :END:"))
#+end_src #+end_src
#+begin_src emacs-lisp :tangle org-config-preface.el #+begin_src emacs-lisp :tangle org-config-preface.el
(defvar imalison:org-dir "~/org") (defvar imalison:org-dir "~/org")