diff options
author | stardiviner <numbchild@gmail.com> | 2018-03-02 14:01:01 +0800 |
---|---|---|
committer | stardiviner <numbchild@gmail.com> | 2018-03-02 14:22:52 +0800 |
commit | 39bd69b08d22dc734c9cb8b8f03445ee6eb76baa (patch) | |
tree | 6740537f89e0158ef6ca448c850ac525a0d09661 | |
parent | 6f976f1947099f15bf82940465bb28a5ee582705 (diff) | |
download | org-mode-39bd69b08d22dc734c9cb8b8f03445ee6eb76baa.tar.gz |
* ob-core.el: (org-babel-execute-src-block) handle :results graphics :file case.
Don't write result to file if result is graphics.
-rw-r--r-- | lisp/ob-core.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 6af10dc..a948ea7 100644 --- a/lisp/ob-core.el +++ b/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 |