org: tangle org-config during export

This commit is contained in:
2026-02-04 00:13:04 -08:00
parent 9b42d002cf
commit 2f2bb59693
2 changed files with 14 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
* include-file-as-forms * include-file-as-forms
We're going to use this to write separate parts of our config to different sections that will then be provided to our use package statment We're going to use this to write separate parts of our config to different sections that will then be provided to our use package statment
#+begin_src emacs-lisp #+begin_src emacs-lisp :tangle org-config.el
(defun imalison:include-file-as-forms (filename) (defun imalison:include-file-as-forms (filename)
"Include the contents of FILENAME into the source as s-expressions." "Include the contents of FILENAME into the source as s-expressions."
(with-temp-buffer (with-temp-buffer
@@ -15,7 +15,7 @@ We're going to use this to write separate parts of our config to different secti
`,@(nreverse forms)))) `,@(nreverse forms))))
#+end_src #+end_src
* use-package * use-package
#+begin_src emacs-lisp #+begin_src emacs-lisp :tangle org-config.el
(defmacro imalison:org-config () (defmacro imalison:org-config ()
`(use-package org `(use-package org
:ensure nil :ensure nil
@@ -29,6 +29,15 @@ We're going to use this to write separate parts of our config to different secti
(imalison:org-config) (imalison:org-config)
#+end_src #+end_src
* My Customization Variables * 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 "
:PROPERTIES:
:ID: %(org-id-new)
:CREATED: %U
:END:")
#+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")
(defvar imalison:shared-org-dir "~/org") (defvar imalison:shared-org-dir "~/org")

View File

@@ -19,6 +19,9 @@
(require 's) (require 's)
(org-babel-tangle-file readme-src) (org-babel-tangle-file readme-src)
(require 'cl-lib)
(load-file (concat emacs-dir "org-config-bootstrap.el"))
(org-babel-tangle-file (concat emacs-dir "org-config.org"))
(load-file (concat emacs-dir "org-config.el")) (load-file (concat emacs-dir "org-config.el"))
(defun export-target (target) (defun export-target (target)