Load org-config preface on direct load
This commit is contained in:
@@ -30,13 +30,20 @@ We're going to use this to write separate parts of our config to different secti
|
||||
#+end_src
|
||||
* My Customization Variables
|
||||
#+begin_src emacs-lisp :tangle org-config.el
|
||||
;; Ensure core org variables exist even when org-config.el is loaded directly.
|
||||
(defvar imalison:org-dir "~/org")
|
||||
(defvar imalison:created-property-string "
|
||||
;; Load org-config-preface when org-config.el is loaded directly.
|
||||
(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 "
|
||||
:PROPERTIES:
|
||||
:ID: %(org-id-new)
|
||||
:CREATED: %U
|
||||
:END:")
|
||||
:END:"))
|
||||
#+end_src
|
||||
#+begin_src emacs-lisp :tangle org-config-preface.el
|
||||
(defvar imalison:org-dir "~/org")
|
||||
|
||||
Reference in New Issue
Block a user