From 9cc1718dc73199e8cd2ae1e6cc4108623b6e58a1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 30 May 2013 20:29:48 +0200 Subject: [PATCH 1/2] Revert "export backends: Fix "PDF file ... wasn't produced" error with relative paths" This reverts commit 752a4eb49d1dff09b4a59e31bf29128a3202dc22. --- contrib/lisp/ox-groff.el | 2 +- lisp/ox-latex.el | 2 +- lisp/ox-man.el | 2 +- lisp/ox-texinfo.el | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el index cd7b78c2b..ca50b18cf 100644 --- a/contrib/lisp/ox-groff.el +++ b/contrib/lisp/ox-groff.el @@ -1949,7 +1949,7 @@ Return PDF file name or an error if it couldn't be produced." ;; Collect standard errors from output buffer. (setq errors (org-groff-collect-errors outbuf)))) (t (error "No valid command to process to PDF"))) - (let ((pdffile (concat (file-name-sans-extension full-name) ".pdf"))) + (let ((pdffile (concat out-dir base-name ".pdf"))) ;; Check for process failure. Provide collected errors if ;; possible. (if (not (file-exists-p pdffile)) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index f9f188539..41cf1d0d7 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2892,7 +2892,7 @@ Return PDF file name or an error if it couldn't be produced." ;; Collect standard errors from output buffer. (setq errors (and (not snippet) (org-latex--collect-errors outbuf))))) (t (error "No valid command to process to PDF"))) - (let ((pdffile (concat (file-name-sans-extension full-name) ".pdf"))) + (let ((pdffile (concat out-dir base-name ".pdf"))) ;; Check for process failure. Provide collected errors if ;; possible. (if (not (file-exists-p pdffile)) diff --git a/lisp/ox-man.el b/lisp/ox-man.el index 55a79f76b..4a5add893 100644 --- a/lisp/ox-man.el +++ b/lisp/ox-man.el @@ -1233,7 +1233,7 @@ Return PDF file name or an error if it couldn't be produced." ;; Collect standard errors from output buffer. (setq errors (org-man-collect-errors outbuf)))) (t (error "No valid command to process to PDF"))) - (let ((pdffile (concat (file-name-sans-extension full-name) ".pdf"))) + (let ((pdffile (concat out-dir base-name ".pdf"))) ;; Check for process failure. Provide collected errors if ;; possible. (if (not (file-exists-p pdffile)) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index bca49e3d3..b5663240a 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1827,7 +1827,7 @@ Return INFO file name or an error if it couldn't be produced." ;; Collect standard errors from output buffer. (setq errors (org-texinfo-collect-errors outbuf)))) (t (error "No valid command to process to Info"))) - (let ((infofile (concat (file-name-sans-extension full-name) ".info"))) + (let ((infofile (concat out-dir base-name ".info"))) ;; Check for process failure. Provide collected errors if ;; possible. (if (not (file-exists-p infofile)) From 0018428c256b09b964439fde75cca702b9ddcca6 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 30 May 2013 20:29:34 +0200 Subject: [PATCH 2/2] export back-ends: Fix subtree export with a relative path * lisp/ox-latex.el (org-latex-compile): Properly set working directory. * lisp/ox-man.el (org-man-compile): Properly set working directory. * lisp/ox-texinfo.el (org-texinfo-compile): Properly set working directory. * contrib/lisp/ox-groff.el (org-groff-compile): Properly set working directory. --- contrib/lisp/ox-groff.el | 7 ++++--- lisp/ox-latex.el | 7 ++++--- lisp/ox-man.el | 7 ++++--- lisp/ox-texinfo.el | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el index ca50b18cf..6ffba98c4 100644 --- a/contrib/lisp/ox-groff.el +++ b/contrib/lisp/ox-groff.el @@ -1919,9 +1919,10 @@ Return PDF file name or an error if it couldn't be produced." (let* ((base-name (file-name-sans-extension (file-name-nondirectory file))) (full-name (file-truename file)) (out-dir (file-name-directory file)) - ;; Make sure `default-directory' is set to FILE directory, - ;; not to whatever value the current buffer may have. - (default-directory (file-name-directory full-name)) + ;; Properly set working directory for compilation. + (default-directory (if (file-name-absolute-p texfile) + (file-name-directory full-name) + default-directory)) errors) (message (format "Processing Groff file %s ..." file)) (save-window-excursion diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 41cf1d0d7..18be4133c 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2862,9 +2862,10 @@ Return PDF file name or an error if it couldn't be produced." (let* ((base-name (file-name-sans-extension (file-name-nondirectory texfile))) (full-name (file-truename texfile)) (out-dir (file-name-directory texfile)) - ;; Make sure `default-directory' is set to TEXFILE directory, - ;; not to whatever value the current buffer may have. - (default-directory (file-name-directory full-name)) + ;; Properly set working directory for compilation. + (default-directory (if (file-name-absolute-p texfile) + (file-name-directory full-name) + default-directory)) errors) (unless snippet (message (format "Processing LaTeX file %s..." texfile))) (save-window-excursion diff --git a/lisp/ox-man.el b/lisp/ox-man.el index 4a5add893..41410cfea 100644 --- a/lisp/ox-man.el +++ b/lisp/ox-man.el @@ -1204,9 +1204,10 @@ Return PDF file name or an error if it couldn't be produced." (let* ((base-name (file-name-sans-extension (file-name-nondirectory file))) (full-name (file-truename file)) (out-dir (file-name-directory file)) - ;; Make sure `default-directory' is set to FILE directory, - ;; not to whatever value the current buffer may have. - (default-directory (file-name-directory full-name)) + ;; Properly set working directory for compilation. + (default-directory (if (file-name-absolute-p texfile) + (file-name-directory full-name) + default-directory)) errors) (message (format "Processing Groff file %s..." file)) (save-window-excursion diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index b5663240a..28ff1f8bc 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1798,9 +1798,10 @@ Return INFO file name or an error if it couldn't be produced." (let* ((base-name (file-name-sans-extension (file-name-nondirectory file))) (full-name (file-truename file)) (out-dir (file-name-directory file)) - ;; Make sure `default-directory' is set to FILE directory, - ;; not to whatever value the current buffer may have. - (default-directory (file-name-directory full-name)) + ;; Properly set working directory for compilation. + (default-directory (if (file-name-absolute-p texfile) + (file-name-directory full-name) + default-directory)) errors) (message (format "Processing Texinfo file %s..." file)) (save-window-excursion