From 4d585c51d5701b4d43c02db78c7032658cae47fd Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 1 Jun 2022 21:43:32 -0400 Subject: Only handle `:haunt-metadata' when present --- ox-haunt.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ox-haunt.el b/ox-haunt.el index 5d42f98..1e5e64d 100644 --- a/ox-haunt.el +++ b/ox-haunt.el @@ -60,6 +60,7 @@ This can be specified on a per-file basis with the 'HAUNT_BASE_DIR' keyword." :type 'string) +;; Notably, this excludes :haunt-metadata, which we handle separately. (defcustom ox-haunt-recognized-metadata '(:title :date :tags) "A list of keywords to include in the Haunt metadata section." :type '(list symbol)) @@ -149,8 +150,11 @@ INFO is the current state of the export process, as a plist." (insert (format "%s: %s\n" (substring (symbol-name keyword) 1) (ox-haunt--keyword-as-string info keyword))))) - (dolist (p (read (ox-haunt--keyword-as-string info :haunt-metadata))) - (insert (format "%s: %s\n" (car p) (cdr p)))) + ;; Handle :haunt-metadata, which we deliberately exclude from + ;; `ox-haunt-recognized-metadata'. + (when (plist-get info :haunt-metadata) + (dolist (p (read (ox-haunt--keyword-as-string info :haunt-metadata))) + (insert (format "%s: %s\n" (car p) (cdr p))))) (buffer-string)) "---\n" ;; Output the article contents. -- cgit v1.3