From 1c9f85bcb93dbc56d01b138f5a4a11ad0933b5c6 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Fri, 19 Sep 2014 14:46:37 -0400 Subject: [PATCH] ox: warn if unexpanded macros are found when exporting * lisp/ox.el (org-export-macro-warn): New function. * lisp/ox-latex.el: Use it. --- lisp/ox-latex.el | 1 + lisp/ox.el | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index f59d6b2..7670ccb 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -65,6 +65,7 @@ (latex-fragment . org-latex-latex-fragment) (line-break . org-latex-line-break) (link . org-latex-link) + (macro . org-export-macro-warn) (node-property . org-latex-node-property) (paragraph . org-latex-paragraph) (plain-list . org-latex-plain-list) diff --git a/lisp/ox.el b/lisp/ox.el index f01f951..a4988f4 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5619,6 +5619,11 @@ to `:default' encoding. If it fails, return S." (plist-get translations :default) s))) +(defun org-export-macro-warn (macro contents info) + ;; TODO: should this be a user-error? + (message "WARNING: undefined macro %s" (org-element-property :key macro)) + ;; Return empty string to avoid interfering with the export output. + "") ;;; Asynchronous Export -- 2.1.0