summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-12-11 08:40:19 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-12-11 08:40:19 +0100
commit2df4c1ca040a5e6f18a89fec5845da34987f9d5f (patch)
tree5f067226b5ab4da8ab68b7b348a41bb7a5ce8de7
parent7dc0f4e4be4d5d8bc29d95736bdf11f1bf95ae42 (diff)
downloadorg-mode-2df4c1ca040a5e6f18a89fec5845da34987f9d5f.tar.gz
New hook org-export-first-hook
-rwxr-xr-xlisp/ChangeLog16
-rw-r--r--lisp/org-ascii.el1
-rw-r--r--lisp/org-docbook.el2
-rw-r--r--lisp/org-exp.el4
-rw-r--r--lisp/org-html.el1
-rw-r--r--lisp/org-latex.el2
-rw-r--r--lisp/org-xoxo.el1
7 files changed, 27 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index de6aff0..d24e46f 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-11 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-xoxo.el (org-export-as-xoxo): Run `org-export-first-hook'.
+
+ * org-latex.el (org-export-region-as-latex): Run
+ `org-export-first-hook'.
+
+ * org-html.el (org-export-as-html): Run `org-export-first-hook'.
+
+ * org-docbook.el (org-export-as-docbook): Run
+ `org-export-first-hook'.
+
+ * org-ascii.el (org-export-as-ascii): Run `org-export-first-hook'.
+
+ * org-exp.el (org-export-first-hook): New hook.
+
2009-12-10 Carsten Dominik <carsten.dominik@gmail.com>
* org-list.el (org-previous-item): Exit at the beginning of the
diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el
index 947c2e4..3019a1a 100644
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -156,6 +156,7 @@ resulting ASCII as a string. When BODY-ONLY is set, don't produce
the file header and footer. When PUB-DIR is set, use this as the
publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
(setq-default org-todo-line-regexp org-todo-line-regexp)
(let* ((opt-plist (org-combine-plists (org-default-export-plist)
ext-plist
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index 0153fd9..2a04310 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -384,6 +384,8 @@ header and footer, simply return the content of the document (all
top-level sections). When PUB-DIR is set, use this as the
publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
+
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
(not buffer-file-name))
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 797f1f0..ca8d2f6 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -357,6 +357,10 @@ drawer names to export."
(repeat :tag "Selected drawers"
(string :tag "Drawer name"))))
+(defvar org-export-first-hook nil
+ "Hook called as the first thing in each exporter.
+Good for general initialization")
+
(defvar org-export-preprocess-hook nil
"Hook for preprocessing an export buffer.
Pretty much the first thing when exporting is running this hook.")
diff --git a/lisp/org-html.el b/lisp/org-html.el
index b012a75..8869ad6 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -539,6 +539,7 @@ the file header and footer, simply return the content of
<body>...</body>, without even the body tags themselves. When
PUB-DIR is set, use this as the publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 8403bf9..f73576d 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -521,6 +521,8 @@ simply return the content of \begin{document}...\end{document},
without even the \begin{document} and \end{document} commands.
when PUB-DIR is set, use this as the publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
+
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
(not buffer-file-name))
diff --git a/lisp/org-xoxo.el b/lisp/org-xoxo.el
index 40feef2..a46f5d1 100644
--- a/lisp/org-xoxo.el
+++ b/lisp/org-xoxo.el
@@ -43,6 +43,7 @@
"Export the org buffer as XOXO.
The XOXO buffer is named *xoxo-<source buffer name>*"
(interactive (list (current-buffer)))
+ (run-hooks 'org-export-first-hook)
;; A quickie abstraction
;; Output everything as XOXO