diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2009-06-19 07:39:26 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2009-06-19 07:39:26 +0200 |
commit | 4643c2d7f33f89bde9cc13fb6fad8a1c3d1779c2 (patch) | |
tree | 92536845d0f3c95ce43fa356588517df572a7140 | |
parent | e9028c2d0d4f9fffa981a285455a6cbe290e06bd (diff) | |
download | org-mode-4643c2d7f33f89bde9cc13fb6fad8a1c3d1779c2.tar.gz |
Export: Find macro definitions in #+SETUPFILE definitions
Macro definitions can now be included in a file linked to by a
directive #+SETUPFILE.
-rwxr-xr-x | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/org-exp.el | 19 |
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac2858b..64ca411 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-06-19 Carsten Dominik <carsten.dominik@gmail.com> + + * org-exp.el (org-infile-export-plist): Get macros also from + #+SETUPFILE. + 2009-06-18 Carsten Dominik <carsten.dominik@gmail.com> * org-colview.el (org-columns-capture-view): Protect vertical bars diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 9758966..6d8dd4a 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -642,10 +642,10 @@ modified) list.") '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE" "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER" "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS" - "KEYWORDS" "DESCRIPTION") + "KEYWORDS" "DESCRIPTION" "MACRO") (mapcar 'car org-export-inbuffer-options-extra)))) p key val text options a pr style - latex-header + latex-header macros ext-setup-or-nil setup-contents (start 0)) (while (or (and ext-setup-or-nil (string-match re ext-setup-or-nil start) @@ -682,6 +682,8 @@ modified) list.") (setq p (plist-put p :select-tags (org-split-string val)))) ((string-equal key "EXPORT_EXCLUDE_TAGS") (setq p (plist-put p :exclude-tags (org-split-string val)))) + ((string-equal key "MACRO") + (push val macros)) ((equal key "SETUPFILE") (setq setup-contents (org-file-contents (expand-file-name @@ -715,13 +717,12 @@ modified) list.") (setq p (plist-put p :macro-input-file (and (buffer-file-name) (file-name-nondirectory (buffer-file-name))))) - (goto-char (point-min)) - (while (re-search-forward - "^#\\+macro:[ \t]+\\([-a-zA-Z0-9_]+\\)[ \t]+\\(.*?[ \t]*$\\)" - nil t) - (setq p (plist-put p (intern (concat ":macro-" - (downcase (match-string 1)))) - (match-string 2)))) + (while (setq val (pop macros)) + (when (string-match "^\\([-a-zA-Z0-9_]+\\)[ \t]+\\(.*?[ \t]*$\\)" val) + (setq p (plist-put + p (intern + (concat ":macro-" (downcase (match-string 1 val)))) + (match-string 2))))) p)))) (defun org-export-add-options-to-plist (p options) |