From 9f9aa52f142e4ffd0bdd2c8ec9a684c9bd452efe Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 4 Aug 2014 10:53:54 +0200 Subject: [PATCH] ox: Provide output file name, if any, to back-ends * lisp/ox.el (org-export-to-file): Provide output file name in communication channel, through :output-file property. This change is needed to fix back-ends needing this information during the process, e.g., `texinfo'. --- lisp/ox.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index 6d07a2e8a..21cf8fbb5 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -1333,6 +1333,10 @@ The back-end could then be called with, for example: ;; - category :: option ;; - type :: string ;; +;; + `:output-file' :: Full path to output file, if any. +;; - category :: option +;; - type :: string or nil +;; ;; + `:parse-tree' :: Whole parse tree, available at any time during ;; transcoding. ;; - category :: option @@ -5674,7 +5678,8 @@ The function returns either a file name returned by POST-PROCESS, or FILE." (declare (indent 2)) (if (not (file-writable-p file)) (error "Output file not writable") - (let ((encoding (or org-export-coding-system buffer-file-coding-system))) + (let ((ext-plist (org-combine-plists `(:output-file ,file) ext-plist)) + (encoding (or org-export-coding-system buffer-file-coding-system))) (if async (org-export-async-start `(lambda (file) -- 2.11.4.GIT