diff options
authorNicolas Goaziou <>2012-10-08 10:54:43 (GMT)
committer Nicolas Goaziou <>2012-10-08 11:03:14 (GMT)
commit19a28c552894e1cd83af10a0ccbbe021e339954a (patch)
parentfaa9eaa2738e113287237261506458dac38461ae (diff)
org-e-publish: Fix publishing for files not directly in :base-directory
* contrib/lisp/org-e-publish.el (org-e-publish-org-to-pdf): Don't expect every file from a project to sit in :base-directory. (org-e-publish-org-to): Make publishing directory optional.
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/lisp/org-e-publish.el b/contrib/lisp/org-e-publish.el
index 517c7ad..49e3551 100644
--- a/contrib/lisp/org-e-publish.el
+++ b/contrib/lisp/org-e-publish.el
@@ -540,17 +540,20 @@ matching filenames."
;;; Pluggable publishing back-end functions
-(defun org-e-publish-org-to (backend filename extension plist pub-dir)
+(defun org-e-publish-org-to (backend filename extension plist &optional pub-dir)
"Publish an Org file to a specified back-end.
BACKEND is a symbol representing the back-end used for
transcoding. FILENAME is the filename of the Org file to be
published. EXTENSION is the extension used for the output
string, with the leading dot. PLIST is the property list for the
-given project. PUB-DIR is the publishing directory.
+given project.
+Optional argument PUB-DIR, when non-nil is the publishing
Return output file name."
- (unless (file-exists-p pub-dir) (make-directory pub-dir t))
+ (unless (or (not pub-dir) (file-exists-p pub-dir)) (make-directory pub-dir t))
;; Check if a buffer visiting FILENAME is already open.
(let* ((visitingp (find-buffer-visiting filename))
(work-buffer (or visitingp (find-file-noselect filename))))
@@ -592,12 +595,10 @@ publishing directory.
Return output file name."
(require 'org-e-latex nil t)
;; Unlike to `org-e-publish-org-to-latex', PDF file is generated in
- ;; base directory and then moved to publishing directory.
+ ;; working directory and then moved to publishing directory.
- (org-e-latex-compile
- (org-e-publish-org-to
- 'e-latex filename ".tex" plist (plist-get plist :base-directory)))
+ (org-e-latex-compile (org-e-publish-org-to 'e-latex filename ".tex" plist))
(defun org-e-publish-org-to-html (plist filename pub-dir)