summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-10-08 10:54:43 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2012-10-08 11:03:14 (GMT)
commit19a28c552894e1cd83af10a0ccbbe021e339954a (patch)
treefe637610938d30247b0e9a6f4cc54e4d77f485ad
parentfaa9eaa2738e113287237261506458dac38461ae (diff)
downloadorg-mode-19a28c552894e1cd83af10a0ccbbe021e339954a.zip
org-mode-19a28c552894e1cd83af10a0ccbbe021e339954a.tar.gz
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.
-rw-r--r--contrib/lisp/org-e-publish.el15
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
+directory.
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-publish-attachment
plist
- (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))
pub-dir))
(defun org-e-publish-org-to-html (plist filename pub-dir)