]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-io.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / org / ob-io.el
index 206482660561654bb17bde342541a09c01224088..25e012de604923fd1a9efb84f8703897e6febe31 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ob-io.el --- org-babel functions for Io evaluation
 
-;; Copyright (C) 2012  Free Software Foundation, Inc.
+;; Copyright (C) 2012-2015 Free Software Foundation, Inc.
 
 ;; Author: Andrzej Lichnerowicz
 ;; Keywords: literate programming, reproducible research
 
 ;;; Code:
 (require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
 (eval-when-compile (require 'cl))
 
+(defvar org-babel-tangle-lang-exts) ;; Autoloaded
 (add-to-list 'org-babel-tangle-lang-exts '("io" . "io"))
 (defvar org-babel-default-header-args:io '())
 (defvar org-babel-io-command "io"
   "Name of the command to use for executing Io code.")
 
-
 (defun org-babel-execute:io (body params)
   "Execute a block of Io code with org-babel.  This function is
 called by `org-babel-execute-src-block'"
@@ -97,12 +94,11 @@ in BODY as elisp."
     (value (let* ((src-file (org-babel-temp-file "io-"))
                   (wrapper (format org-babel-io-wrapper-method body)))
              (with-temp-file src-file (insert wrapper))
-             ((lambda (raw)
-                (if (member "code" result-params)
-                    raw
-                  (org-babel-io-table-or-string raw)))
-              (org-babel-eval
-               (concat org-babel-io-command " " src-file) ""))))))
+             (let ((raw (org-babel-eval
+                         (concat org-babel-io-command " " src-file) "")))
+               (org-babel-result-cond result-params
+                raw
+                 (org-babel-io-table-or-string raw)))))))
 
 
 (defun org-babel-prep-session:io (session params)