Browse Source

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.
Nicolas Goaziou 12 years ago
parent
commit
0018428c25
4 changed files with 16 additions and 12 deletions
  1. 4 3
      contrib/lisp/ox-groff.el
  2. 4 3
      lisp/ox-latex.el
  3. 4 3
      lisp/ox-man.el
  4. 4 3
      lisp/ox-texinfo.el

+ 4 - 3
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

+ 4 - 3
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

+ 4 - 3
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

+ 4 - 3
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