diff options
| author | Jakob L. Kreuze | 2024-07-13 17:55:47 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2024-07-13 17:55:47 -0400 |
| commit | 7f37518e4792f040a753a5d8d68d51e76cc0b2be (patch) | |
| tree | af2c8dc358f97094a6c7e10a0aadcc21ad8a5cc5 /haunt/jakob/reader/org-mode.scm | |
| parent | 5474f016ddec56542999f8ee6c0d6c887dee75e8 (diff) | |
Initial migration to org-reader
Long-term I would like to merge the =posts-assets= and =posts= directories but
currently Haunt will crash if something exists in the =posts= directory that
can't be processed by a reader
Diffstat (limited to 'haunt/jakob/reader/org-mode.scm')
| -rw-r--r-- | haunt/jakob/reader/org-mode.scm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/haunt/jakob/reader/org-mode.scm b/haunt/jakob/reader/org-mode.scm index 7f064f1..b55dbf3 100644 --- a/haunt/jakob/reader/org-mode.scm +++ b/haunt/jakob/reader/org-mode.scm @@ -49,6 +49,10 @@ (or (getenv "HAUNT_ORG_READER_CACHE_DIR") "./.org-mode-reader-cache/")))) +;; File name of Elisp script to execute before anything else +(define %additional-emacs-preamble + (make-parameter (getenv "HAUNT_ORG_READER_EMACS_PREAMBLE"))) + ;; Additional Org-mode keywords to include in the extracted metadata. (define %additional-keys (make-parameter '("CROSSPOST" "SCRIPTS" "META-TAGS"))) @@ -62,7 +66,13 @@ If `%use-emacsclient' is truthy, evaluate FORM in the current running Emacs daemon. Assumes that FORM does not write to `standard-output'." - (let* (;; We need to explicitly request that Emacs write the result if using + (let* (;; If `HAUNT_ORG_READER_PREAMBLE' is specified, load that. + (form (if (%additional-emacs-preamble) + `(progn + (load-file ,(%additional-emacs-preamble)) + ,form) + form)) + ;; We need to explicitly request that Emacs write the result if using ;; Emacs batch mode (which is how we evaluate forms without ;; `emacsclient'.) (form (if (not (%use-emacsclient)) |