]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-shen.el
Fix "Beginning of buffer" error in forward-page
[gnu-emacs] / lisp / org / ob-shen.el
index 8f4b13217c69935441024b3235221475fc2f1ebd..413fe0d42ca3d34fb15270b9a0713e5d6e70ed9c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ob-shen.el --- org-babel functions for Shen
 
-;; Copyright (C) 2010-201 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2016 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