Explorar o código

* ob-core.el: (org-babel-execute-src-block) handle :results graphics :file case.

Don't write result to file if result is graphics.
stardiviner %!s(int64=7) %!d(string=hai) anos
pai
achega
39bd69b08d
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      lisp/ob-core.el

+ 8 - 5
lisp/ob-core.el

@@ -702,13 +702,16 @@ block."
 			       (not (listp r)))
 			  (list (list r))
 			r)))
-	      (let ((file (cdr (assq :file params))))
+	      (let ((file (cdr (assq :file params)))
+		    (result-graphics (member "graphics" (cdr (assq :result-params params)))))
 		;; If non-empty result and :file then write to :file.
 		(when file
-		  (when result
-		    (with-temp-file file
-		      (insert (org-babel-format-result
-			       result (cdr (assq :sep params))))))
+		  ;; handle :results graphics :file case. don't write result to file if result is graphics.
+		  (unless result-graphics
+		    (when result
+		      (with-temp-file file
+			(insert (org-babel-format-result
+				 result (cdr (assq :sep params)))))))
 		  (setq result file))
 		;; Possibly perform post process provided its
 		;; appropriate.  Dynamically bind "*this*" to the