summaryrefslogtreecommitdiff
path: root/haunt/jakob/reader/org-mode.scm
diff options
context:
space:
mode:
Diffstat (limited to 'haunt/jakob/reader/org-mode.scm')
-rw-r--r--haunt/jakob/reader/org-mode.scm12
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))