Browse Source

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'.
Nicolas Goaziou 10 years ago
parent
commit
9f9aa52f14
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lisp/ox.el

+ 6 - 1
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)