Bladeren bron

New hook org-export-first-hook

Carsten Dominik 15 jaren geleden
bovenliggende
commit
2df4c1ca04
7 gewijzigde bestanden met toevoegingen van 27 en 0 verwijderingen
  1. 16 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-ascii.el
  3. 2 0
      lisp/org-docbook.el
  4. 4 0
      lisp/org-exp.el
  5. 1 0
      lisp/org-html.el
  6. 2 0
      lisp/org-latex.el
  7. 1 0
      lisp/org-xoxo.el

+ 16 - 0
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>
 2009-12-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
 	* org-list.el (org-previous-item): Exit at the beginning of the
 	* org-list.el (org-previous-item): Exit at the beginning of the

+ 1 - 0
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
 the file header and footer.  When PUB-DIR is set, use this as the
 publishing directory."
 publishing directory."
   (interactive "P")
   (interactive "P")
+  (run-hooks 'org-export-first-hook)
   (setq-default org-todo-line-regexp org-todo-line-regexp)
   (setq-default org-todo-line-regexp org-todo-line-regexp)
   (let* ((opt-plist (org-combine-plists (org-default-export-plist)
   (let* ((opt-plist (org-combine-plists (org-default-export-plist)
 					ext-plist
 					ext-plist

+ 2 - 0
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
 top-level sections).  When PUB-DIR is set, use this as the
 publishing directory."
 publishing directory."
   (interactive "P")
   (interactive "P")
+  (run-hooks 'org-export-first-hook)
+
   ;; Make sure we have a file name when we need it.
   ;; Make sure we have a file name when we need it.
   (when (and (not (or to-buffer body-only))
   (when (and (not (or to-buffer body-only))
 	     (not buffer-file-name))
 	     (not buffer-file-name))

+ 4 - 0
lisp/org-exp.el

@@ -357,6 +357,10 @@ drawer names to export."
 	  (repeat :tag "Selected drawers"
 	  (repeat :tag "Selected drawers"
 		  (string :tag "Drawer name"))))
 		  (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
 (defvar org-export-preprocess-hook nil
   "Hook for preprocessing an export buffer.
   "Hook for preprocessing an export buffer.
 Pretty much the first thing when exporting is running this hook.")
 Pretty much the first thing when exporting is running this hook.")

+ 1 - 0
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
 <body>...</body>, without even the body tags themselves.  When
 PUB-DIR is set, use this as the publishing directory."
 PUB-DIR is set, use this as the publishing directory."
   (interactive "P")
   (interactive "P")
+  (run-hooks 'org-export-first-hook)
 
 
   ;; Make sure we have a file name when we need it.
   ;; Make sure we have a file name when we need it.
   (when (and (not (or to-buffer body-only))
   (when (and (not (or to-buffer body-only))

+ 2 - 0
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.
 without even the \begin{document} and \end{document} commands.
 when PUB-DIR is set, use this as the publishing directory."
 when PUB-DIR is set, use this as the publishing directory."
   (interactive "P")
   (interactive "P")
+  (run-hooks 'org-export-first-hook)
+
   ;; Make sure we have a file name when we need it.
   ;; Make sure we have a file name when we need it.
   (when (and (not (or to-buffer body-only))
   (when (and (not (or to-buffer body-only))
 	     (not buffer-file-name))
 	     (not buffer-file-name))

+ 1 - 0
lisp/org-xoxo.el

@@ -43,6 +43,7 @@
   "Export the org buffer as XOXO.
   "Export the org buffer as XOXO.
 The XOXO buffer is named *xoxo-<source buffer name>*"
 The XOXO buffer is named *xoxo-<source buffer name>*"
   (interactive (list (current-buffer)))
   (interactive (list (current-buffer)))
+  (run-hooks 'org-export-first-hook)
   ;; A quickie abstraction
   ;; A quickie abstraction
 
 
   ;; Output everything as XOXO
   ;; Output everything as XOXO