summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-11-03 17:43:04 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2012-11-03 17:43:04 +0100
commitd8a3b84c9346b379fe1f7ab7d55fcd08367d2622 (patch)
tree04434761676387be5f5d187588d68416eebb542e
parent203d5123bcd873c4756b538ce59f2226bd188c6a (diff)
downloadorg-mode-d8a3b84c9346b379fe1f7ab7d55fcd08367d2622.tar.gz
org-export: New function to locally use another back-end
* contrib/lisp/org-export.el (org-export-with-backend): New function. * contrib/lisp/org-e-beamer.el (org-e-beamer-link): Use new function.
-rw-r--r--contrib/lisp/org-e-beamer.el3
-rw-r--r--contrib/lisp/org-export.el28
2 files changed, 27 insertions, 4 deletions
diff --git a/contrib/lisp/org-e-beamer.el b/contrib/lisp/org-e-beamer.el
index 94336d7..8743cc2 100644
--- a/contrib/lisp/org-e-beamer.el
+++ b/contrib/lisp/org-e-beamer.el
@@ -725,8 +725,7 @@ used as a communication channel."
path
contents))))))))
;; Otherwise, use `e-latex' back-end.
- (t (funcall (cdr (assq 'link org-e-latex-translate-alist))
- link contents info)))))
+ (t (org-export-with-backend 'e-latex link contents info)))))
;;;; Plain List
diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el
index 7afcd8d..0d7dbf7 100644
--- a/contrib/lisp/org-export.el
+++ b/contrib/lisp/org-export.el
@@ -2545,8 +2545,6 @@ Return the updated communication channel."
;; was within an item, the item should contain the headline. That's
;; why file inclusion should be done before any structure can be
;; associated to the file, that is before parsing.
-;;
-;; Macro are expanded with `org-export-expand-macro'.
(defun org-export-as
(backend &optional subtreep visible-only body-only ext-plist noexpand)
@@ -2986,6 +2984,28 @@ Caption lines are separated by a white space."
(setq caption (nconc (list " ") (copy-sequence cap) caption)))))))
+;;;; For Derived Back-ends
+;;
+;; `org-export-with-backend' is a function allowing to locally use
+;; another back-end to transcode some object or element. In a derived
+;; back-end, it may be used as a fall-back function once all specific
+;; cases have been treated.
+
+(defun org-export-with-backend (back-end data &rest args)
+ "Call a transcoder from BACK-END on DATA."
+ (org-export-barf-if-invalid-backend back-end)
+ (let ((type (org-element-type data)))
+ (if (or (memq type '(nil org-data)))
+ (error "No foreign transcoder available")
+ (let ((transcoder (cdr (assq type
+ (symbol-value
+ (intern (format "org-%s-translate-alist"
+ back-end)))))))
+ (if (not (functionp transcoder))
+ (error "No foreign transcoder available")
+ (apply transcoder data args))))))
+
+
;;;; For Export Snippets
;;
;; Every export snippet is transmitted to the back-end. Though, the
@@ -3153,6 +3173,10 @@ INFO is the plist used as a communication channel."
;; `org-export-low-level-p', `org-export-first-sibling-p' and
;; `org-export-last-sibling-p' are three useful predicates when it
;; comes to fulfill the `:headline-levels' property.
+;;
+;; `org-export-get-tags', `org-export-get-category' and
+;; `org-export-get-node-property' extract useful information from an
+;; headline or a parent headline. They all handle inheritance.
(defun org-export-get-relative-level (headline info)
"Return HEADLINE relative level within current parsed tree.