]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-shen.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / org / ob-shen.el
index ec31546a0acecfe7b68b51dd83951bfc804a1fcf..190d69b7678f0acbca321f809e421ce5af5e8560 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ob-shen.el --- org-babel functions for Shen
 
-;; Copyright (C) 2010-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2015 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research, shen
@@ -36,6 +36,7 @@
 (require 'ob)
 
 (declare-function shen-eval-defun "ext:inf-shen" (&optional and-go))
+(declare-function org-babel-ruby-var-to-ruby "ob-ruby" (var))
 
 (defvar org-babel-default-header-args:shen '()
   "Default header arguments for shen code blocks.")
@@ -65,15 +66,14 @@ This function is called by `org-babel-execute-src-block'"
   (let* ((result-type (cdr (assoc :result-type params)))
         (result-params (cdr (assoc :result-params params)))
          (full-body (org-babel-expand-body:shen body params)))
-    ((lambda (results)
-       (if (or (member 'scalar result-params)
-              (member 'verbatim result-params))
-          results
-        (condition-case nil (org-babel-script-escape results)
-          (error results))))
-     (with-temp-buffer
-       (insert full-body)
-       (call-interactively #'shen-eval-defun)))))
+    (let ((results
+           (with-temp-buffer
+             (insert full-body)
+             (call-interactively #'shen-eval-defun))))
+      (org-babel-result-cond result-params 
+        results
+        (condition-case nil (org-babel-script-escape results)
+          (error results))))))
 
 (provide 'ob-shen)
 ;;; ob-shen.el ends here