Browse Source

fixed issue in org-babel-temp-file when forcing extension types

* lisp/ob-C.el (org-babel-C-execute): corrected arguments to
  org-babel-temp-file

* lisp/ob-latex.el (org-babel-execute:latex): corrected arguments to
  org-babel-temp-file

* lisp/ob.el (org-babel-temp-file): corrected arguments to
  make-temp-file
Eric Schulte 9 years ago
parent
commit
e3d271ea5b
3 changed files with 8 additions and 6 deletions
  1. 5 4
      lisp/ob-C.el
  2. 2 1
      lisp/ob-latex.el
  3. 1 1
      lisp/ob.el

+ 5 - 4
lisp/ob-C.el

@@ -84,10 +84,11 @@ header arguments (calls `org-babel-C-expand')."
   "This function should only be called by `org-babel-execute:C'
 or `org-babel-execute:c++'."
   (let* ((processed-params (org-babel-process-params params))
-         (tmp-src-file (org-babel-temp-file "C-src-" nil
-                                       (cond
-					((equal org-babel-c-variant 'c) ".c")
-					((equal org-babel-c-variant 'cpp) ".cpp"))))
+         (tmp-src-file (org-babel-temp-file
+			"C-src-"
+			(cond
+			 ((equal org-babel-c-variant 'c) ".c")
+			 ((equal org-babel-c-variant 'cpp) ".cpp"))))
          (tmp-bin-file (org-babel-temp-file "C-bin-"))
          (tmp-out-file (org-babel-temp-file "C-out-"))
          (cmdline (cdr (assoc :cmdline params)))

+ 2 - 1
lisp/ob-latex.el

@@ -70,7 +70,7 @@ This function is called by `org-babel-execute-src-block'."
   (setq body (org-babel-expand-body:latex body params))
   (if (cdr (assoc :file params))
       (let* ((out-file (cdr (assoc :file params)))
-	     (tex-file (org-babel-temp-file "latex-" nil ".tex"))
+	     (tex-file (org-babel-temp-file "latex-" ".tex"))
 	     (border (cdr (assoc :border params)))
 	     (fit (or (cdr (assoc :fit params)) border))
 	     (height (and fit (cdr (assoc :pdfheight params))))
@@ -84,6 +84,7 @@ This function is called by `org-babel-execute-src-block'."
           (org-create-formula-image
            body out-file org-format-latex-options in-buffer))
          ((string-match "\\.pdf$" out-file)
+	  (require 'org-latex)
 	  (with-temp-file tex-file
 	    (insert
 	     (org-splice-latex-header

+ 1 - 1
lisp/ob.el

@@ -1674,7 +1674,7 @@ of `org-babel-temporary-directory'."
   (let ((temporary-file-directory (expand-file-name
 				   org-babel-temporary-directory
 				   temporary-file-directory)))
-    (make-temp-file prefix suffix)))
+    (make-temp-file prefix nil suffix)))
 
 (defun org-babel-remove-temporary-directory ()
   "Remove `org-babel-temporary-directory' on Emacs shutdown."