summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-11-22 14:02:21 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2012-11-22 14:02:21 (GMT)
commitd1a075e6bb273bb19b4ed1a9eb9a3e44fc63a9ee (patch)
tree6292ff7b206e4719f0ba4c19bb76fde38f581854
parentcc998ccbada9e42f0d046453d763f3ad96c8d235 (diff)
downloadorg-mode-d1a075e6bb273bb19b4ed1a9eb9a3e44fc63a9ee.zip
org-mode-d1a075e6bb273bb19b4ed1a9eb9a3e44fc63a9ee.tar.gz
org-export: Allow variable arity in `org-export-with-backend'
* contrib/lisp/org-export.el (org-export-with-backend): Allow to ignore contents and info, if necessary. Also fix code typo.
-rw-r--r--contrib/lisp/org-export.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el
index 1ae5472..8a1f57c 100644
--- a/contrib/lisp/org-export.el
+++ b/contrib/lisp/org-export.el
@@ -2983,15 +2983,17 @@ Caption lines are separated by a white space."
;; 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."
+(defun org-export-with-backend (back-end data &optional contents info)
+ "Call a transcoder from BACK-END on DATA.
+CONTENTS, when non-nil, is the transcoded contents of DATA
+element, as a string. INFO, when non-nil, is the communication
+channel used for export, as a plist.."
(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")
+ (if (memq type '(nil org-data)) (error "No foreign transcoder available")
(let ((transcoder
(cdr (assq type (org-export-backend-translate-table back-end)))))
- (if (functionp transcoder) (apply transcoder data args)
+ (if (functionp transcoder) (funcall transcoder contents info)
(error "No foreign transcoder available"))))))